Chinaunix首页 | 论坛 | 博客
  • 博客访问: 19054
  • 博文数量: 3
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 40
  • 用 户 组: 普通用户
  • 注册时间: 2014-11-01 15:11
文章分类

全部博文(3)

文章存档

2014年(3)

我的朋友

分类: 虚拟化

2014-11-25 20:57:34

vSphere命令行概述

在管理vSphere设备时,除了可以使用图形界面外,还可以使用vSphere命令行。vSphere官方文档介绍如下:

vSphere supports several command-line interfaces for managing your virtual infrastructure including the vSphere Command-Line Interface (vCLI), a set of ESXi Shell commands, and PowerCLI. You can choose the CLI set best suited for your needs, and write scripts to automate your CLI tasks.

点击
意思是说vSphere支持几种命令行交互界面,包括vSphere Command-Line Interface (vCLI)ESXi Shell命令集PowerCLI。你可以选择合适的命令写成脚本来自动执行任务。

命令集主要有以下几个:

  • ESXCLI 1、在ESXi Shell中运行;2、安装vCLI后运行;3、部署vMA后运行
  • esxcfg- 过时的版本,在5.0之后使用ESXCLI命令集取代。但在系统中仍然保留
  • vicfg- 1、安装vCLI后运行;2、部署vMA后运行
  • VMware PowerCLI 需要安装vSphere PowerCLI,前提是系统中有PowerShell
  • localcliESXCLI命令集相同,但仅在宿主机不可用并且无法重启时使用,并且使用后需重启宿主机

esxcli命令行

  • esxcli fcoe :FCoE相关功能
    • adapter [list]
    • nic [disable|discover|list]
  1. ~ # esxcli fcoe
  2. Usage: esxcli fcoe {cmd} [cmd options]
  3. Available Namespaces:
  4. adapter Operations that can be performed on FCOE-type storage HBAs
  5. nic Operations that can be performed on FCOE-capable CNA devices
  6. ~ # esxcli fcoe adapter
  7. Usage: esxcli fcoe adapter {cmd} [cmd options]
  8. Available Commands:
  9. list List FCOE-capable CNA devices.
  10. ~ # esxcli fcoe nic
  11. Usage: esxcli fcoe nic {cmd} [cmd options]
  12. Available Commands:
  13. disable Disable rediscovery of FCOE storage on behalf of an FCOE-capable
  14. CNA upon next boot.
  15. discover Initiate FCOE adapter discovery on behalf of an FCOE-capable
  16. CNA.
  17. list List FCOE-capable CNA devices.
  18. ~ #
  • esxcli hardware:查看硬件信息功能
    • cpu [list]
    • bootdevice [list]
    • clock [get|set}
    • memory [get]
    • pci [list]
    • platform [get]
  1. ~ # esxcli hardware cpu
  2. Usage: esxcli hardware cpu {cmd} [cmd options]
  3. Available Namespaces:
  4. cpuid Information from the CPUID instruction on each CPU.
  5. global Information and configuration global to all CPUs.
  6. Available Commands:
  7. list List all of the CPUs on this host. \\查看cpu的详细信息



  1. ~ # esxcli hardware bootdevice
  2. Usage: esxcli hardware bootdevice {cmd} [cmd options]
  3. Available Commands:
  4. list List the boot device order, if available, for this host.
  5. ~ #
  1. ~ # esxcli hardware clock
  2. Usage: esxcli hardware clock {cmd} [cmd options]
  3. Available Commands:
  4. get Disply the current hardware clock time.
  5. set Set the hardware clock time. Any missing parameters will default
  6. to the current time.
  7. ~ #

  1. ~ # esxcli hardware memory
  2. Usage: esxcli hardware memory {cmd} [cmd options]
  3. Available Commands:
  4. get Get information about memory.
  5. ~ # esxcli hardware memory get
  6. Physical Memory: 4294430720 Bytes
  7. NUMA Node Count: 1
  8. ~ #
  1. ~ # esxcli hardware pci
  2. Usage: esxcli hardware pci {cmd} [cmd options]
  3. Available Commands:
  4. list List all of the PCI devices on this host.
  5. ~ #

  1. ~ # esxcli hardware platform
  2. Usage: esxcli hardware platform {cmd} [cmd options]
  3. Available Commands:
  4. get Get information about the platform
  5. ~ # esxcli hardware platform get
  6. Platform Information
  7. UUID: 0x56 0x4d 0xda 0x14 0xe6 0x33 0x26 0xbe 0xf1 0x4c 0x77 0x56 0xe2 0x50 0x40 0x60
  8. Product Name: VMware Virtual Platform
  9. Vendor Name: VMware, Inc.
  10. Serial Number: VMware-56 4d da 14 e6 33 26 be-f1 4c 77 56 e2 50 40 60
  11. IPMI Supported: false
  12. ~ #
  • esxcli iscsi:ISCSI相关功能
    • adapter [get|list|set]
    • networkportal [add|list|remove]
    • physicalnetworkportal [list]
    • session [add|list|remove]
    • ibftboot [get|import]
    • logicalnetworkportal list
    • plugin list
    • software [get|set]
  • esxcli network:网络相关功能
    • fence [list]
    • firewall [get|load|refresh|set|unload]
    • ip [get|set]
    • vswitch
    • nic [down | get | list | set| up]
  1. ~ # esxcli network fence
  2. Usage: esxcli network fence {cmd} [cmd options]
  3. Available Namespaces:
  4. network Commands to list fence network information
  5. Available Commands:
  6. list Get all fence switch info on the system.
  7. ~ # esxcli network fence network
  8. Usage: esxcli network fence network {cmd} [cmd options]
  9. Available Namespaces:
  10. bte Commands to list fence network bte information
  11. port Commands to list fence network port information
  12. Available Commands:
  13. list Get all fence network info on the vds.
  14. ~ # esxcli network fence list
  15. ~ #
  • esxcli software:软件相关功能
  • esxcli storage:存储相关功能
  • esxcli system:系统相关功能
  • esxcli vm:虚拟机相关功能




阅读(1728) | 评论(0) | 转发(0) |
0

上一篇:Python学习笔记之四:字典

下一篇:没有了

给主人留下些什么吧!~~