虚拟化之esxi命令行管理

VMware vSphere PowerCLI 是一款功能强大的命令行工具,可自动执行 vSphere 的各方面管理,包括主机、网络、存储、虚拟机、客户操作系统等等。 PowerCLI 作为 Windows PowerShell 插件分发,包括超过 150 个 PowerShell cmdlet,以及文档和示例。 PowerCLI 将 vSphere 平台与 Windows 和 .*-NET 无缝地融合在一起,这意味着您可以单独使用 PowerCLI,也可以在众多其他第三方工具中使用。

~ # esxcfg-vswitch -l
Switch Name      Num Ports   Used Ports  Configured Ports  MTU     Uplinks
vSwitch0         128         5           128               1500    vmnic0

  PortGroup Name        VLAN ID  Used Ports  Uplinks
  VM Network            0        1           vmnic0
  Management Network    0        1           vmnic0

两种方法

1.直接在ESXi界面上按住ALT+F1也能进入
2.把ESXi的SSH功能开开,然后用工具连接行了,root/password。

开启后,会有感叹号

主机>配置>安全配置文件

~ # esxcli system -h
Usage: esxcli system {cmd} [cmd options]

Available Namespaces:
  boot                  Operations relating to host boot that allow manipulation of VMkernel boot time configuration.
  coredump              Operations pertaining to the VMkernel Core dump configuration.
  module                Operations that allow manipulation of the VMkernel loadable modules and device drivers. Operations include load, list and setting
                        options.
  process               Commands relating to running processes.
  secpolicy             Options related to VMkernel access control subsystem. These options are typically in place for specific workarounds or debugging.
                        These commands should be used at the direction of VMware Support Engineers.
  settings              Operations that allow viewing and manipulation of system settings.
  stats                 Access to various system statistics
  syslog                Operations relating to system logging
  visorfs               Operations pertaining to the visorfs memory filesytem.
  hostname              Operations pertaining the network name of the ESX host.
  maintenanceMode       Command to manage the system‘s maintenance mode.
  shutdown              Command to shutdown the system.
  snmp                  Commands pertaining to SNMPv1/v2c/v3 Agent configuration.
  time                  Commands to get and set system time.
  uuid                  Get the system UUID
  version               Commands to get version information.
  welcomemsg            Commands to get and set the welcome banner for DCUI.

~ # esxcli system version
Usage: esxcli system version {cmd} [cmd options]

Available Commands:
  get                   Display the product name, version and build information.
~ # esxcli system version get
   Product: VMware ESXi
   Version: 5.1.0
   Build: Releasebuild-1065491
   Update: 1
~ # esxcli esxcli command list
Namespace                                               Command
------------------------------------------------------  -----------
esxcli.command                                          list
fcoe.adapter                                            list
fcoe.nic                                                disable
fcoe.nic                                                discover
fcoe.nic                                                list
hardware.bootdevice                                     list
hardware.clock                                          get
hardware.clock                                          set
hardware.cpu.cpuid                                      get
hardware.cpu.global                                     get
hardware.cpu.global                                     set
hardware.cpu                                            list
hardware.ipmi.fru                                       get
hardware.ipmi.fru                                       list
hardware.ipmi.sdr                                       get
hardware.ipmi.sdr                                       list
hardware.ipmi.sel                                       get
hardware.ipmi.sel                                       list
hardware.memory                                         get
hardware.pci                                            list
hardware.platform                                       get
hardware.trustedboot                                    get
iscsi.adapter.auth.chap                                 get
iscsi.adapter.auth.chap                                 set
iscsi.adapter.capabilities                              get
iscsi.adapter.discovery                                 rediscover
iscsi.adapter.discovery.sendtarget                      add
iscsi.adapter.discovery.sendtarget.auth.chap            get
iscsi.adapter.discovery.sendtarget.auth.chap            set
iscsi.adapter.discovery.sendtarget                      list
iscsi.adapter.discovery.sendtarget.param                get
iscsi.adapter.discovery.sendtarget.param                set
iscsi.adapter.discovery.sendtarget                      remove
iscsi.adapter.discovery.statictarget                    add
iscsi.adapter.discovery.statictarget                    list
iscsi.adapter.discovery.statictarget                    remove
iscsi.adapter.discovery.status                          get
iscsi.adapter.firmware                                  get
iscsi.adapter.firmware                                  set
iscsi.adapter                                           get
iscsi.adapter                                           list
iscsi.adapter.param                                     get
iscsi.adapter.param                                     set
iscsi.adapter                                           set
iscsi.adapter.target                                    list
iscsi.adapter.target.portal.auth.chap                   get
iscsi.adapter.target.portal.auth.chap                   set
iscsi.adapter.target.portal                             list
iscsi.adapter.target.portal.param                       get
iscsi.adapter.target.portal.param                       set
iscsi.ibftboot                                          get
iscsi.ibftboot                                          import
iscsi.logicalnetworkportal                              list
iscsi.networkportal                                     add
iscsi.networkportal.ipconfig                            get
iscsi.networkportal.ipconfig                            set
iscsi.networkportal                                     list
iscsi.networkportal                                     remove
iscsi.physicalnetworkportal                             list
iscsi.physicalnetworkportal.param                       get
iscsi.physicalnetworkportal.param                       set
iscsi.plugin                                            list
iscsi.session                                           add
iscsi.session.connection                                list
iscsi.session                                           list
iscsi.session                                           remove
iscsi.software                                          get
iscsi.software                                          set
network.diag                                            ping
network.fence                                           list
network.fence.network.bte                               list
network.fence.network                                   list
network.fence.network.port                              list
network.firewall                                        get
network.firewall                                        load
network.firewall                                        refresh
network.firewall.ruleset.allowedip                      add
network.firewall.ruleset.allowedip                      list
network.firewall.ruleset.allowedip                      remove
network.firewall.ruleset                                list
network.firewall.ruleset.rule                           list
network.firewall.ruleset                                set
network.firewall                                        set
network.firewall                                        unload
network.ip.connection                                   list
network.ip.dns.search                                   add
network.ip.dns.search                                   list
network.ip.dns.search                                   remove
network.ip.dns.server                                   add
network.ip.dns.server                                   list
network.ip.dns.server                                   remove
network.ip                                              get
network.ip.interface                                    add
network.ip.interface.ipv4                               get
network.ip.interface.ipv4                               set
network.ip.interface.ipv6.address                       add
network.ip.interface.ipv6.address                       list
network.ip.interface.ipv6.address                       remove
network.ip.interface.ipv6                               get
network.ip.interface.ipv6                               set
network.ip.interface                                    list
network.ip.interface                                    remove
network.ip.interface                                    set
network.ip.interface.tag                                add
network.ip.interface.tag                                get
network.ip.interface.tag                                remove
network.ip.ipsec.sa                                     add
network.ip.ipsec.sa                                     list
network.ip.ipsec.sa                                     remove
network.ip.ipsec                                        set
network.ip.ipsec.sp                                     add
network.ip.ipsec.sp                                     list
network.ip.ipsec.sp                                     remove
network.ip.neighbor                                     list
network.ip.route.ipv4                                   add
network.ip.route.ipv4                                   list
network.ip.route.ipv4                                   remove
network.ip.route.ipv6                                   add
network.ip.route.ipv6                                   list
network.ip.route.ipv6                                   remove
network.ip                                              set
network.nic                                             down
network.nic                                             get
network.nic                                             list
network.nic                                             set
network.nic.stats                                       get
network.nic                                             up
network.nic.vlan.stats                                  get
network.nic.vlan.stats                                  set
network.port.filter.stats                               get
network.port.stats                                      get
network.sriovnic                                        list
network.sriovnic.vf                                     list
network.vm                                              list
network.vm.port                                         list
network.vswitch.dvs.vmware.lacp.get                     config
network.vswitch.dvs.vmware.lacp.get                     stats
network.vswitch.dvs.vmware.lacp.get                     status
network.vswitch.dvs.vmware                              list
network.vswitch.dvs.vmware.vxlan.config.stats           get
network.vswitch.dvs.vmware.vxlan.config.stats           set
network.vswitch.dvs.vmware.vxlan                        list
network.vswitch.dvs.vmware.vxlan.network                list
network.vswitch.dvs.vmware.vxlan.network.mapping        list
network.vswitch.dvs.vmware.vxlan.network.mapping        reset
network.vswitch.dvs.vmware.vxlan.network.port           list
network.vswitch.dvs.vmware.vxlan.network.port.stats     list
network.vswitch.dvs.vmware.vxlan.network.port.stats     reset
network.vswitch.dvs.vmware.vxlan.network.stats          list
network.vswitch.dvs.vmware.vxlan.network.stats          reset
network.vswitch.dvs.vmware.vxlan.stats                  list
network.vswitch.dvs.vmware.vxlan.stats                  reset
network.vswitch.dvs.vmware.vxlan.vmknic                 list
network.vswitch.dvs.vmware.vxlan.vmknic.multicastgroup  list
network.vswitch.dvs.vmware.vxlan.vmknic.stats           list
network.vswitch.dvs.vmware.vxlan.vmknic.stats           reset
network.vswitch.standard                                add
network.vswitch.standard                                list
network.vswitch.standard.policy.failover                get
network.vswitch.standard.policy.failover                set
network.vswitch.standard.policy.security                get
network.vswitch.standard.policy.security                set
network.vswitch.standard.policy.shaping                 get
network.vswitch.standard.policy.shaping                 set
network.vswitch.standard.portgroup                      add
network.vswitch.standard.portgroup                      list
network.vswitch.standard.portgroup.policy.failover      get
network.vswitch.standard.portgroup.policy.failover      set
network.vswitch.standard.portgroup.policy.security      get
network.vswitch.standard.portgroup.policy.security      set
network.vswitch.standard.portgroup.policy.shaping       get
network.vswitch.standard.portgroup.policy.shaping       set
network.vswitch.standard.portgroup                      remove
network.vswitch.standard.portgroup                      set
network.vswitch.standard                                remove
network.vswitch.standard                                set
network.vswitch.standard.uplink                         add
network.vswitch.standard.uplink                         remove
sched.swap.system                                       get
sched.swap.system                                       set
software.acceptance                                     get
software.acceptance                                     set
software.profile                                        get
software.profile                                        install
software.profile                                        update
software.profile                                        validate
software.sources.profile                                get
software.sources.profile                                list
software.sources.vib                                    get
software.sources.vib                                    list
software.vib                                            get
software.vib                                            install
software.vib                                            list
software.vib                                            remove
software.vib                                            update
storage.core.adapter                                    list
storage.core.adapter                                    rescan
storage.core.adapter.stats                              get
storage.core.claiming                                   autoclaim
storage.core.claiming                                   reclaim
storage.core.claiming                                   unclaim
storage.core.claimrule                                  add
storage.core.claimrule                                  convert
storage.core.claimrule                                  list
storage.core.claimrule                                  load
storage.core.claimrule                                  move
storage.core.claimrule                                  remove
storage.core.claimrule                                  run
storage.core.device.detached                            list
storage.core.device.detached                            remove
storage.core.device                                     list
storage.core.device.partition                           list
storage.core.device.partition                           showguid
storage.core.device                                     set
storage.core.device                                     setconfig
storage.core.device.smart                               get
storage.core.device.stats                               get
storage.core.device.vaai.status                         get
storage.core.device.world                               list
storage.core.path                                       list
storage.core.path                                       set
storage.core.path.stats                                 get
storage.core.plugin                                     list
storage.core.plugin.registration                        add
storage.core.plugin.registration                        list
storage.core.plugin.registration                        remove
storage.filesystem                                      automount
storage.filesystem                                      list
storage.filesystem                                      mount
storage.filesystem                                      rescan
storage.filesystem                                      unmount
storage.nfs                                             add
storage.nfs                                             list
storage.nfs                                             remove
storage.nmp.device                                      list
storage.nmp.device                                      set
storage.nmp.path                                        list
storage.nmp.psp.fixed.deviceconfig                      get
storage.nmp.psp.fixed.deviceconfig                      set
storage.nmp.psp.generic.deviceconfig                    get
storage.nmp.psp.generic.deviceconfig                    set
storage.nmp.psp.generic.pathconfig                      get
storage.nmp.psp.generic.pathconfig                      set
storage.nmp.psp                                         list
storage.nmp.psp.roundrobin.deviceconfig                 get
storage.nmp.psp.roundrobin.deviceconfig                 set
storage.nmp.satp.generic.deviceconfig                   get
storage.nmp.satp.generic.deviceconfig                   set
storage.nmp.satp.generic.pathconfig                     get
storage.nmp.satp.generic.pathconfig                     set
storage.nmp.satp                                        list
storage.nmp.satp.rule                                   add
storage.nmp.satp.rule                                   list
storage.nmp.satp.rule                                   remove
storage.nmp.satp                                        set
storage.san.fc.events                                   clear
storage.san.fc.events                                   get
storage.san.fc                                          list
storage.san.fc                                          reset
storage.san.fc.stats                                    get
storage.san.fcoe                                        list
storage.san.fcoe                                        reset
storage.san.fcoe.stats                                  get
storage.san.iscsi                                       list
storage.san.iscsi.stats                                 get
storage.san.sas                                         list
storage.san.sas                                         reset
storage.san.sas.stats                                   get
storage.vmfs.extent                                     list
storage.vmfs.snapshot.extent                            list
storage.vmfs.snapshot                                   list
storage.vmfs.snapshot                                   mount
storage.vmfs.snapshot                                   resignature
storage.vmfs                                            upgrade
system.boot.device                                      get
system.coredump.network                                 check
system.coredump.network                                 get
system.coredump.network                                 set
system.coredump.partition                               get
system.coredump.partition                               list
system.coredump.partition                               set
system.hostname                                         get
system.hostname                                         set
system.maintenanceMode                                  get
system.maintenanceMode                                  set
system.module                                           get
system.module                                           list
system.module                                           load
system.module.parameters                                list
system.module.parameters                                set
system.module                                           set
system.process                                          list
system.process.stats.load                               get
system.process.stats.running                            get
system.secpolicy.domain                                 list
system.secpolicy.domain                                 set
system.settings.advanced                                list
system.settings.advanced                                set
system.settings.kernel                                  list
system.settings.kernel                                  set
system.settings.keyboard.layout                         get
system.settings.keyboard.layout                         list
system.settings.keyboard.layout                         set
system.shutdown                                         poweroff
system.shutdown                                         reboot
system.snmp                                             get
system.snmp                                             hash
system.snmp                                             set
system.snmp                                             test
system.stats.uptime                                     get
system.syslog.config                                    get
system.syslog.config.logger                             list
system.syslog.config.logger                             set
system.syslog.config                                    set
system.syslog                                           mark
system.syslog                                           reload
system.time                                             get
system.time                                             set
system.uuid                                             get
system.version                                          get
system.visorfs                                          get
system.visorfs.ramdisk                                  add
system.visorfs.ramdisk                                  list
system.visorfs.ramdisk                                  remove
system.visorfs.tardisk                                  list
system.welcomemsg                                       get
system.welcomemsg                                       set
vm.process                                              kill
vm.process                                              list
~ # esxcli software acceptance get
PartnerSupported

~ # esxcli software vib list
Name                           Version                               Vendor  Acceptance Level  Install Date
-----------------------------  ------------------------------------  ------  ----------------  ------------
ata-pata-amd                   0.3.10-3vmw.510.0.0.799733            VMware  VMwareCertified   2014-05-22
ata-pata-atiixp                0.4.6-4vmw.510.0.0.799733             VMware  VMwareCertified   2014-05-22
ata-pata-cmd64x                0.2.5-3vmw.510.0.0.799733             VMware  VMwareCertified   2014-05-22
ata-pata-hpt3x2n               0.3.4-3vmw.510.0.0.799733             VMware  VMwareCertified   2014-05-22
ata-pata-pdc2027x              1.0-3vmw.510.0.0.799733               VMware  VMwareCertified   2014-05-22
ata-pata-serverworks           0.4.3-3vmw.510.0.0.799733             VMware  VMwareCertified   2014-05-22
~ # esxcli software vib get -n ata-pata-amd
VMware_bootbank_ata-pata-amd_0.3.10-3vmw.510.0.0.799733
   Name: ata-pata-amd
   Version: 0.3.10-3vmw.510.0.0.799733
   Type: bootbank
   Vendor: VMware
   Acceptance Level: VMwareCertified
   Summary: pata_amd: ata driver for VMware ESX
   Description: AMD/NVidia PATA Driver
   ReferenceURLs:
   Creation Date: 2012-08-02
   Depends: vmkapi_2_1_0_0, com.vmware.driverAPI-9.2.1.0, com.vmware.libata-9.2.1.0
   Conflicts:
   Replaces:
   Provides:
   Maintenance Mode Required: True
   Hardware Platforms Required:
   Live Install Allowed: False
   Live Remove Allowed: False
   Stateless Ready: True
   Overlay: False
   Tags: driver, module
   Payloads: ata-pata
~ # esxcli software profile get
(Updated) ESXi-5.1.0-20130402001-standard
   Name: (Updated) ESXi-5.1.0-20130402001-standard
   Vendor: localhost
   Creation Time: 2014-05-23T18:02:36
   Modification Time: 2015-02-16T06:28:57
   Stateless Ready: True
   Description:

      2014-05-23T18:02:29.976940+00:00: The following VIBs are
      installed:
        vmware-fdm    5.1.0-799731
      ----------
      For more information, see http://kb.vmware.com/kb/2041635.
时间: 2024-10-03 18:59:54

虚拟化之esxi命令行管理的相关文章

3.学会命令行管理代码

3.学会命令行管理代码大航海时代1:世界的创建 --------------表的操作:海贼王世界CREATE DATABASE ONE_PIECEDROP DATABASE ONE_PIECE CREATE TABLE ROLE(ID INT IDENTITY(1,1) ,NAME VARCHAR(20),AGE INT ,REWARD INT ) CREATE TABLE AREA(ID INT IDENTITY(1,1),NAME VARCHAR(20),REMARK TEXT,)SP_RE

[转]玩转Windows服务系列——命令行管理Windows服务

本文转自:http://www.cnblogs.com/hbccdf/p/managewindowsservicewithcmd.html 说到Windows服务的管理就不得不说通过命令行的方式管理Windows服务,因为无论是系统管理员,还是通过编程的方式调用cmd命令,命令行都是非常方便以及强大的工具. 接下来就看一下如何通过cmd命令管理Windows服务. 管理Windows服务的主要cmd命令 管理Windows服务的命令应该有很多,但是我所了解到的命令主要有两个:sc.net. 说是

使用SqlLocalDB命令行管理LocalDB

SqlLocalDB.exe start v11.0 SqlLocalDB.exe info v11.0 SQL Server Management Stdio添加管道连接实例 默认实例名(localDB)\v11.0 为了方便管理,LocalDB提供了一个基于命令行的数据库管理工具SqlLocalDB.exe.下面是SqlLocalDB.exe的路径: %ProgramFiles%\Microsoft SQL Server\110\Tools\Binn 我们可以在Windows操作系统的CMD

IIS命令行管理工具使用

AppCmd.exe工具所在目录 C:\windows\sytstem32\inetsrv\目录下 一条命令批量添加应用程序 c:\Windows\System32\inetsrv>for /d %i in (e:\wwwroot\*.*) do appcmd add app /site.name:"Default Web Site" /path:/%~ni /physicalpath:%i 使用命令行管理IIS 7.0时,需要使用IIS7.0提供的全新管理工具AppCmd.ex

RHEL7 124 之从命令行管理文件(2)

从命令行管理文件 [[email protected] ~]# cd /[[email protected] /]# lsbin  dev  home  lib64 mnt  proc  run  srv  tmp  varboot etc  lib   media opt  root  sbin sys  usr  xx /bin /dev 包含特殊的设备文件,供系统用于访问硬件 /home 普通用户存储其个人数据和配置文件的主目录 /root root的主目录 /lib64 /mnt /pr

ios-使用命令行管理svn

一些svn工具管理方便直观,但在效率上相比,还是命令行快一些. (由于记性不好,经常忘一些知识,比如命令行几天不用就生疏了,为了防止忘了再找资料回忆.备份一下svn命令以备后用) 查看svn全部log svn log (log太多,想停止,ctrl+z) 查看svn信息 svn info 查看当前svn关联目录下的文件改动 svn st 提交代码 svn ci yourfile.m yourfile2.m -m "提交了两个m文件" 比较某个文件与svn上代码的改动 svn diff

命令行管理和维护RHCS集群

1.启动RHCS集群 RHCS集群的核心进程有cman和rgmanager,要启动集群,一次在集群的每个节点上执行如下命令: service cman start service rgmanager start 执行着两个命令是有先后顺序的,要先启动cman,然后再启动rgmanager. [[email protected] ~]# service cman start Starting cluster: Checking if cluster has been disabled at boo

virsh命令行管理工具

Libvirt有两种控制方式,命令行和图形界面 图形界面: 通过执行名virt-manager,启动libvirt的图形界面,在图形界面下可以一步一步的创建虚拟机,管理虚拟机,还可以直接控制虚拟机的桌面. 命令行: virsh list                                                  #显示本地活动虚拟机 virsh list –all                                           #显示本地所有的虚拟机(活

部署及命令行管理KVM

通过博文部署及图形化管理KVM已经可以通过图形化的方式来管理KVM平台的虚拟机.本篇博文主要介绍如何通过命令行的方式来管理KVM平台的虚拟机. 博文大纲:一.环境要求二.安装方式三.远程连接KVM虚拟机的方法四.使用默认的方式使KVM虚拟机可以访问互联网五.KVM常用命令 一.环境要求 如果是真实服务器,那么就需要在BIOS中开启虚拟化功能(Virtualization Technology),一般物理服务器,此项功能默认都是打开的.如图: 如果实验环境使用VMware Workstation的