VMware vSphere ESXi6.0常用命令

1、简介
    VMware vSphere ESXi6.0常用命令使用,对于一些个人认为比较常用的命令进行总结,如果读者需要了解更多请访问VMware官网下载文档,链接如下:https://www.vmware.com/support/developer/vcli/。
    ESXi命令行获取帮助的方法为<命令关键字 --help>,常用的命令一般都是以esxcli开头,如果忘记命令可以使用帮助:esxcli --help;输出如下:
[root@localhost:~] esxcli --help
Usage: esxcli [options] {namespace}+ {cmd} [cmd options]
Options:
  --formatter=FORMATTER
                        Override the formatter to use for a given command. Available formatter: xml, csv, keyvalue
  --debug               Enable debug or internal use options
  --version             Display version information for the script
  -?, --help            Display usage information for the script
Available Namespaces:
  device                Device manager commands
  elxnet                elxnet esxcli functionality
  esxcli                Commands that operate on the esxcli system itself allowing users to get additional information.
  fcoe                  VMware FCOE commands.
  graphics              VMware graphics commands.
  hardware              VMKernel hardware properties and commands for configuring hardware.
  iscsi                 VMware iSCSI commands.
  network               Operations that pertain to the maintenance of networking on an ESX host. This includes a wide variety of
                        commands to manipulate virtual networking components (vswitch, portgroup, etc) as well as local host IP, DNS and
                        general host networking settings.
  rdma                  Operations that pertain to remote direct memory access (RDMA) protocol stack on an ESX host.
  sched                 VMKernel system properties and commands for configuring scheduling related functionality.
  software              Manage the ESXi software image and packages
  storage               VMware storage commands.
  system                VMKernel system properties and commands for configuring properties of the kernel core system and related system
                        services.
  vm                    A small number of operations that allow a user to Control Virtual Machine operations.
  vsan                  VMware Virtual SAN commands 

2、常用命令
1)、vmware -v
    查看系统版本,例子:
[root@localhost:~] vmware -v
VMware ESXi 6.0.0 build-3620759

2)、esxcli system version get
    查看系统版本包括patch等信息,例子:    
[root@localhost:~] esxcli system version get
Product: VMware ESXi
Version: 6.0.0
Build: Releasebuild-3620759
Update: 2
Patch: 34

3)、esxcli system time get
    查看系统时间,例子:
[root@localhost:~] esxcli system time get
2016-09-13T02:02:39Z

4)、esxcli system time set <options>
    修改系统时间,例子:
Cmd options:
  -d|--day=<long>       Day
  -H|--hour=<long>      Hour
  -m|--min=<long>       Minute
  -M|--month=<long>     Month
  -s|--sec=<long>       Second
  -y|--year=<long>      Year
[root@localhost:~] esxcli system time set -y=2016 -M=9 -d=13 -H=10 -m=9
[root@localhost:~] esxcli system time get
2016-09-13T10:09:27Z

5)、esxcli system maintenanceMode set --enable true/false
    ESXi主机进入/退出,维护模式,例子:
[root@localhost:~] esxcli system maintenanceMode set --enable true
[root@localhost:~] esxcli system maintenanceMode get   //查看维护模式的状态
Enabled
[root@localhost:~] esxcli system maintenanceMode set --enable false
[root@localhost:~] esxcli system maintenanceMode get
Disabled
[root@localhost:~] 

6)、esxcli system shutdown reboot/poweroff
    系统重启/关机(必须处于维护模式,否则命令不生效)

7)、esxcli network ip interface ipv4 get
    查看接口ipv4地址,例子:
[root@localhost:~] esxcli network ip interface ipv4 get
Name  IPv4 Address   IPv4 Netmask   IPv4 Broadcast  Address Type  DHCP DNS
----  -------------  -------------  --------------  ------------  --------
vmk0  10.1.98.165    255.255.255.0   10.1.98.255     STATIC          false

8)、esxcli network ip route ipv4 list
    查看路由表,例子:
[root@localhost:~] esxcli network ip route ipv4 list
Network      Netmask        Gateway        Interface  Source
-----------  -------------  -------------  ---------  ------
default      0.0.0.0        10.1.98.254  vmk0       MANUAL
10.1.98.0  255.255.255.0  0.0.0.0        vmk0       MANUAL

9)、esxcli network nic list
    查看ESXi主机网卡列表(nic)或up-link列表,例子:
[root@localhost:~] esxcli network nic list
Name    PCI Device    Driver  Admin Status  Link Status  Speed  Duplex  MAC Address         MTU  Description
------  ------------  ------  ------------  -----------  -----  ------  -----------------  ----  ---------------------------------------------------
vmnic0  0000:03:00.0  e1000e  Up            Up            1000  Full    00:50:56:9d:bd:b7  1500  Intel Corporation 82574L Gigabit Network Connection
vmnic1  0000:0b:00.0  e1000e  Up            Up            1000  Full    00:50:56:9d:7c:7f  1500  Intel Corporation 82574L Gigabit Network Connection

10)、esxcli network nic down/up -n=vmnic1
    关闭/打开vmnic1接口

11)、esxcli storage core device list
    查看磁盘列表

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

1个字

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值