设为首页 收藏本站
查看: 3932|回复: 0

[经验分享] VMware vSphere ESXi6.0常用命令

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-9-14 10:18:39 | 显示全部楼层 |阅读模式
1、简介
    VMware vSphere ESXi6.0常用命令使用,对于一些个人认为比较常用的命令进行总结,如果读者需要了解更多请访问VMware官网下载文档,链接如下:https://www.vmware.com/support/developer/vcli/
    ESXi命令行获取帮助的方法为<命令关键字 --help>,常用的命令一般都是以esxcli开头,如果忘记命令可以使用帮助:esxcli --help;输出如下:

[iyunv@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
    查看系统版本,例子:
[iyunv@localhost:~] vmware -v
VMware ESXi 6.0.0 build-3620759

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

3)、esxcli system time get
    查看系统时间,例子:

[iyunv@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
[iyunv@localhost:~] esxcli system time set -y=2016 -M=9 -d=13 -H=10 -m=9
[iyunv@localhost:~] esxcli system time get
2016-09-13T10:09:27Z

5)、esxcli system maintenanceMode set --enable true/false
    ESXi主机进入/退出,维护模式,例子:

[iyunv@localhost:~] esxcli system maintenanceMode set --enable true
[iyunv@localhost:~] esxcli system maintenanceMode get   //查看维护模式的状态
Enabled
[iyunv@localhost:~] esxcli system maintenanceMode set --enable false
[iyunv@localhost:~] esxcli system maintenanceMode get
Disabled
[iyunv@localhost:~]

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


7)、esxcli network ip interface ipv4 get
    查看接口ipv4地址,例子:
[iyunv@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
    查看路由表,例子:

[iyunv@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列表,例子:

[iyunv@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
    查看磁盘列表



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-272113-1-1.html 上篇帖子: Vmware Esxi外接移动硬盘到虚拟机拷贝数据慢 下篇帖子: 如何给Red Hat Linux安装Vmware Tools
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表