茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1664785 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_60D_00137.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

小企鵝開談 : [轉貼]Using ESXCLI for Host Management

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15766
[轉貼]Using ESXCLI for Host Management
Using ESXCLI for Host Management

You can manage many aspects of an ESXi host with commands in the ESXCLI command set. You can run ESXCLI commands as vCLI commands, or run them in the ESXi Shell in troubleshooting situations.
You can also run ESXCLI commands from the PowerCLI shell by using the Get-EsxCli cmdlet. See the vSphere PowerCLI User’s Guide and the vSphere PowerCLI Cmdlet Reference.
The set of ESXCLI commands that are available on a host depends on the host configuration. The vSphere Command-Line Interface Reference lists help information for all ESXCLI commands. You can run esxcli --server --help before you run a command on a host to make sure that the command is defined on the host you are targeting.

ESXCLI Syntax
Each ESXCLI command uses the same syntax.
esxcli [dispatcher options] <namespace> [<namespace> ...] <cmd> [cmd options]

■dispatcher options. Predefined options for connection information such as target host, user name, and so on. See Running vCLI Host Management Commands. Not required when you run the command in the ESXi Shell. If the target server is a vCenter Server system, specify the target ESXi host before any ESXCLI namespaces, commands, and supported options.
Many ESXCLI commands generate output you might want to use in your application. You can run esxcli with the --formatter dispatcher option and send the resulting output as input to a parser.
Important Starting with vSphere 6.0, ESXCLI expects a trust relationship between the target host and the system on which you run the command. You can establish this relationship in one of these ways:
■Use the --cacertsfile option or VI_CACERTFILE variable
■Store the thumbprint in the session file.
■Specify the thumbprint with the --thumbprint option or VI_THUMBPRINT variable.
You can pass in the thumbprint that is returned in the error if you trust the host you are targeting. See Trust Relationship Requirement for ESXCLI Commands for an example.
■namespace. Groups ESXCLI commands. vSphere 5.0 and later support nested namespaces.
■command. Reports on or modifies state on the system.
Examples
esxcli --server myESXi --username user1 --password 'my_password' storage nfs list
esxcli --server myVCServer --username user1 --password 'my_pwd' --vihost myESXi.mycompany.com storage nfs list

■options. Many commands support one or more options, displayed in the help or the vCLI Reference. For some commands, multiple option values, separated by spaces, are possible.
Example
esxcli system module parameters set -m <module> -p "a=1 b=1 c=1"

Running ESXCLI vCLI Commands
You can run an ESXCLI vCLI command in the ESXi Shell for troubleshooting and remotely against a specific host or against a vCenter Server system. You have the following choices:
■Deploy the vMA appliance on an ESXi system and authenticate against a set of target servers. You can then run ESXCLI commands against any target server by specifying the --host dispatcher option. No additional authentication is required. See the vSphere Management Assistant Guide.
■Install the vCLI package on one of the supported Windows or Linux systems. The ESXCLI command set is included. Specify connection options to run commands against an ESXi host directly, or target a vCenter Server system and specify the ESXi host to run the command against. See Installing vCLI.
Note Starting with vSphere 6.0, a trust relationship must exist between the host from which you run ESXCLI commands and the target ESXi host or vCenter Server system. See Trust Relationship Requirement for ESXCLI Commands.
See Running vCLI Host Management Commands.
ESXCLI Command Support when Host and vCLI Version Do Not Match
When you run an ESXCLI vCLI command, you must know the commands supported on the target host specified with --server or as a vMA target. For example:
■If you run commands against ESXi 4.x hosts, ESXCLI 4.x commands are supported.
■If you run commands against ESXi 5.0 hosts, ESXCLI 5.0 commands are supported. ESXCLI 5.1 commands that were included in ESXCLI 5.0 are also supported.
■If you run commands against ESXi 5.1 hosts, ESXCLI 5.1 and ESXCLI 5.0 commands are supported.
VMware partners might develop custom ESXCLI commands that you can run on hosts where the partner VIB is installed.
Run esxcli --server --help for a list of namespaces supported on the target. You can drill down into the namespaces for additional help.

原文出處:vSphere 6.0 Documentation Center
前一個主題 | 下一個主題 | 頁首 | | |



Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|