




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、ESX/ESXi 4.0 Remote CLI,Product Support Engineering,VMware Confidential,VI4 - Mod 1-5 - Slide,2,Module 1-5 Lessons,Lesson 1 Virtual Infrastructure Upgrade Lesson 2 ESX 4.0 Install Lesson 3 vCenter Server 4.0 Lesson 4 Virtual Infrastructure 4.0 Licensing Lesson 5 Remote CLI & vSphere Management Assis
2、tant (vMA),VI4 - Mod 1-5 - Slide,3,Module 1-6 Lessons,Lesson 1 Overview of Remote CLI Lesson 2 Using the Remote CLI Lesson 3 Installing Remote CLI on Linux Lesson 4 Installing Remote CLI on Windows Lesson 5 Installing vSphere Management Assistant (vMA) Lesson 6 Configuring vSphere Management Assista
3、nt (vMA),VI4 - Mod 1-5 - Slide,4,vSphere CLI Overview,vSphere CLI commands allow you to perform many of the operations you might currently perform using the ESX Server service console. vSphere CLI commands are especially useful for an ESXi host because it does not include a service console You can u
4、se vSphere CLI commands in scripts that run on those hosts. vSphere CLI commands run on top of the vSphere SDK Perl Toolkit The vSphere SDK Perl Toolkit and prerequisite software are included in the installation package on Windows and on supported Linux distributions. You can use an installable pack
5、age to run vSphere CLI and vSphere SDK Perl Toolkit commands,VI4 - Mod 1-5 - Slide,5,Using vSphere CLI Commands,You can install a vSphere CLI package on either Linux or Microsoft Windows, or import a virtual appliance (vMA) that includes the vSphere CLI and all prerequisite software into your ESX/ES
6、Xi host. vSphere CLI packages You can install a vSphere CLI package on one server, which could become the administration server for all ESX/ESXi hosts. After you have installed the package, you can run vSphere CLI commands or invoke scripts from the operating system command line.Each time you run a
7、command, you specify the connection options directly or indirectly. vMA (vSphere Management Assistant) A virtual machine that includes prepackaged software that developers and administrators can use to run agents and scripts to manage ESX/ESXi systems.vMA includes the vSphere SDK for Perl and vSpher
8、e CLI in a Linux environment.,VI4 - Mod 1-5 - Slide,6,Using vSphere CLI Commands,You can use the vSphere CLI commands interactively or in scripts, as follows: Open a command prompt on a Linux or Windows system where you installed the vSphere CLI and enter commands there. Prepare scripts with sets of
9、 vSphere CLI commands. Then run the scripts from an administration server that has the vSphere CLI package installed or from a vSphere CLI virtual appliance Linux console. Open or access a Linux console on the virtual appliance (vMA), and enter vSphere CLI commands there. When you execute commands,
10、you must specify the ESX/ESXi host on which you want to run the command and the user name and password,VI4 - Mod 1-5 - Slide,7,Using vSphere CLI Commands,Specifying the password in plain text risks exposing the password to other users. The password might also become exposed in backup files. Do not p
11、rovide plain-text passwords on production systems. You have the following alternatives: If you use a vSphere CLI command interactively and do not specify a user name and password, you are prompted. What you type is not echoed to the screen. For noninteractive use, you can create a session file using
12、 the save_session.pl script included in the apps/session directory of the VI Perl Toolkit. If you are running on Windows systems, you can use the passthroughauth command. If the user who runs the command is known, no password is required. If you are running vMA, you can set up target servers and exe
13、cute vSphere CLI commands against target servers without additional authentication.,VI4 - Mod 1-5 - Slide,8,ESX Management vs. vMA,End-user Scripts VMware CLI:esxcfg-*, vmware-cmd,Management Agents,Hardware Agents,Service Console (COS),vMA,VMware ESX/ESXi,CIM SMASH,Updated Management Agents,“Classic
14、” VMware ESX,Updated Hardware Agents,End-user Scripts Remote CLI:vicfg-*, vmware-cmd,VI API,VI4 - Mod 1-5 - Slide,9,vSphere CLI - Linux,The Perl installation script for the vSphere CLI is supported on default installations of the following Linux distributions: Red Hat Enterprise Linux (RHEL) 5.1 (32
15、-bit) vMA (64 bit) A number of prerequisite libraries are included in the default installation of each supported Linux distribution. The vSphere CLI package installer installs the vSphere CLI scripts and the vSphere SDK for Perl,VI4 - Mod 1-5 - Slide,10,To install the vSphere CLI package - Linux,Cop
16、y and extract the vSphere CLI package on your RedHat VM Start the installer vmware-install.pl (vmware-rcli-distrib folder)The installer prompts you to accept the terms of the license agreement. Type yes at the prompt to accept the license terms and press Enter to continue. When prompted, specify an
17、installation directory, or press Enter to accept the default (/usr/bin). If a previous version of the vSphere SDK for Perl or the vSphere CLI package exists on the target system, the installer offers to replace the previous version. Optional If prompted to remove older versions of vSphere SDK for Pe
18、rl or vSphere CLI, you can either accept the offer or install the package on a different system.,VI4 - Mod 1-5 - Slide,11,Executing vSphere CLI Commands,After you have installed the vSphere CLI, you can execute commands from the Linux command prompt or include them in scripts To execute a vSphere CL
19、I command from a Linux command prompt Open a command prompt. Go to the directory where you installed the vSphere CLI. (/usr/bin) Execute the command including the connection options. Specify connection options in a configuration or pass them on the command line. The extension .pl is not required on
20、Linux. For example: vicfg-nas -server my_vcserver -username u42 -password mypwd -vihost my_esxhost -list,VI4 - Mod 1-5 - Slide,12,Uninstalling the vSphere CLI Package,To uninstall the vSphere CLI on a Linux system Connect to the directory where you installed the vSphere CLI. (default is/usr/bin) Exe
21、cute the vmware-uninstall-rcli.pl script.The command uninstalls both the vSphere CLI and the VI Perl Toolkit.,VI4 - Mod 1-5 - Slide,13,Lab Installing vSphere CLI on Linux,Lab 6 Part 1 Installing the RCLI for Linux,VI4 - Mod 1-5 - Slide,14,vSphere CLI - Windows,When you install the vSphere CLI packag
22、e on Windows, the installation package includes all prerequisite software. The vSphere CLI package is supported on the following Windows operating systems: Windows Vista SP 1 Windows XP SP 2,VI4 - Mod 1-5 - Slide,15,Installing the Windows vSphere CLI Package,Download the vSphere CLI Windows installe
23、r from the VMware Communities site for the Release Candidate.The vSphere CLI package is not included with the ESX/ESXi installation. Start the installer.If a previous version of the vSphere SDK for Perl or the vSphere CLI package exists on the target Windows system, the installer offers to replace t
24、he previous version. Optional If prompted to remove older versions of vSphere SDK for Perl or vSphere CLI, you can either accept the offer or install the package on a different system. Click Next in the Welcome page to continue.,VI4 - Mod 1-5 - Slide,16,Installing the Windows vSphere CLI Package,If
25、you do not want to install the vSphere CLI in the default directory, click Change and select a different directory.The default location is the following:C:Program FilesVMwareVMware Infrastructure CLIbin Click Next to continue. Click Install to proceed with the installation.The installation might tak
26、e several minutes to complete. Utility applications C:Program FilesVMwareVMware Infrastructure CLIPerlapps Sample scripts C:Program FilesVMwareVMware Infrastructure CLIPerlsamples,VI4 - Mod 1-5 - Slide,17,Executing vSphere CLI Commands,After you install the vSphere CLI, you can execute commands from
27、 the Windows command prompt or include them in scripts To execute a vSphere CLI command from a Windows command prompt Open a command prompt. Navigate to the directory in which the vSphere CLI is installed.cd C:Program FilesVMwareVMware VI Remote CLIbin Execute the command, passing in the connection
28、options and any other options.pl The extension .pl is required. For example:vicfg-nas.pl -server my_vcserver -username u42 -password mypwd vihost my_esxhost -list,VI4 - Mod 1-5 - Slide,18,Executing vSphere CLI Commands,VI4 - Mod 1-5 - Slide,19,Uninstalling the vSphere CLI Package,You can uninstall t
29、he vSphere CLI package like any other package. To uninstall the vSphere CLI on a Windows system Choose Start Settings Control Panel Add or Remove Programs. In the panel that appears, select vSphere CLI, and click Remove. Click Yes when prompted. The system uninstalls both the vSphere SDK for Perl an
30、d the vSphere CLI package.,VI4 - Mod 1-5 - Slide,20,Specifying Options for vSphere CLI Commands,When you execute a vSphere CLI command, you must specify at a minimum the name of the execution server and the name and password of a user with login privileges. Order of Precedence When you execute a vSp
31、here CLI command, the appliance or vSphere CLI package uses the following order of precedence: Command line Password (-password), session file (-sessionfile), or configuration file (-config) specified on the command line Configuration file Passwords specified in .visdkrc configuration file Environme
32、nt variable Password specified in an environment variable Credential store Password retrieved from the credential store. Current account (Active Directory) You can set up a current account connection using the Windows Security Support Provider Interface (SSPI). Prompt the user for a password. This o
33、rder of precedence always applies. You cannot override an environment variable setting in a configuration file.,VI4 - Mod 1-5 - Slide,21,vSphere CLI - Using a Session File,Connect to the directory where the script is located. For example:Windows: cd C:Program FilesVMwareVMware CLIPerlappssessionLinu
34、x: cd /usr/share/doc/vmware-vicli/samples/session Call save_session.plYou must specify the server to connect to and the name of a session file in which the script saves an authentication cookie.For example:Windows: save_session.pl -savesessionfile C:Tempmy_session-server my_vc_server -vihost my_esx1
35、Linux: save_session.pl -savesessionfile /tmp/vimsession server -username -password If you specify a server but no user name or password, the script prompts you.,VI4 - Mod 1-5 - Slide,22,Adding Target Servers to vMA,Adding Target Servers sudo vifp addserver Example: sudo vifp addserver cs-tse- Result
36、 : Creates users “vi-admin” and “vi-user” on the added server Stores obfuscated credentials on the VIMA appliance,VI4 - Mod 1-5 - Slide,23,vSphere CLI - Using a Session File,Pass in the session file using the -sessionfile option when you execute vSphere CLI commands, as follows: -sessionfile For exa
37、mple: Windows: vicfg-mpath.pl -sessionfile C:Tempmy_session -list Linux: vicfg-mpath -sessionfile /tmp/vimsession -list,VI4 - Mod 1-5 - Slide,24,vSphere CLI - Using Environment Variables,You can set environment variables In a Linux profile, In the Environment properties of the dialog box of the Micr
38、osoft System control panel For the current session, at the command line. For example: set VI_SERVER=,VI4 - Mod 1-5 - Slide,25,vSphere CLI - Using a Configuration File,You use a text file that contains variable names and settings as a configuration file. Pass in the configuration file when you execut
39、e vSphere CLI commands, as follows: -config -list For example: vicfg-mpath -config -list To administer multiple vCenter Server or ESX/ESXi systems create multiple configuration files with different names. To execute a command or a set of commands on a server, you pass in the-config option with the a
40、ppropriate filename at the command line. If you specify -config, the system ignores the settings in the .visdkrc file.,VI4 - Mod 1-5 - Slide,26,Examples for Specifying Connection Options,Example for Using a Configuration File The following example shows the contents of a configuration file: VI_SERVE
41、R = NN.NNN.NNN.NNVI_USERNAME = rootVI_PASSWORD = my_passwordVI_PROTOCOL = httpsVI_PORTNUMBER = 443 If you have set up your system to run this file, you can execute scripts on the specified server afterwards. NOTE The password is in plain text, so you must limit access to this file.,VI4 - Mod 1-5 - S
42、lide,27,vSphere CLI - Using Command-Line Options,You can pass in command-line options using option name and option value pairs. Some options have no value (-help) - The following syntax results: -server -username -password -vihost NOTE: Enclose passwords and other text with special characters in quo
43、tation marks. On Linux, use single quotes ( ), on Windows, use double quotes (“ “). On Linux, you can also use a backslash () before special characters. Linux vicfg-mpath -server -user snow-white -password dwarf$vicfg-mpath -server -user snow-white -password dwarf$ Windows vicfg-mpath.pl -server -us
44、er “snow-white” -password “dwarf$”,VI4 - Mod 1-5 - Slide,28,Microsoft Windows Security Support Provider Interface,You can use the -passthroughauth command-line argument to log in to a vCenter Server Using -passthroughauth passes the credentials of the user who runs the command to the server If the e
45、xecuting user is known by the Source and Destination no additional authentication is required. SSPI supports a number of protocols. By default, it chooses the Negotiate protocol you can use -passthroughauthpackage to specify another protocol supported by SSPI e.g. Kerberos vicfg-mpath -server -passt
46、hroughauth -passthroughauthpackage “Kerberos” -list,VI4 - Mod 1-5 - Slide,29,Using vSphere CLI Commands in Scripts,Editing Files on ESXi Hosts You cannot edit a file on ESXi hosts directly because there is no service console. You must retrieve the file from the host, make the change or changes, and th
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 母猪健康跟踪与数据利用研究试题及答案
- 系统架构设计师考试评估模型试题及答案
- 护士资格证考试患者积极健康管理考题及答案
- 紧跟趋势的2024文化产业管理考试试题及答案
- 美术史论尝试题及答案大全
- 广东建造师试题及答案
- 系统规划与管理师复习中的知识点掌握要领试题及答案
- 药品研发流程学习试题及答案
- 系统规划与管理师考试流程解析试题及答案
- 推动护士资格证备考多元化的试题及答案
- 如何进行六年级数学总复习的讲座
- 保密工作会议上的讲话(6篇)
- 2023年中国铁路南宁局招聘笔试参考题库附带答案详解
- 造纸机的电气传动系统毕业设计
- 初中学段劳动任务清单(七到九年级)
- 多菌灵安全技术说明书
- 纪检监察工作使用表格目录
- 超声医学简答题(完全版)
- TSDPIA 05-2022 宠物猫砂通用技术规范
- 2023年河南工业和信息化职业学院单招面试题库及答案解析
- 国企治理三会一层详解
评论
0/150
提交评论