Transcription of vSphere Command-Line Interface Installation and Reference ...
1 vSphere Command-Line InterfaceInstallation and Reference GuideESX/ESXi Server EN-000111-00 VMware, Hillview Alto, CA , Command-Line Interface Installation and Reference Guide You can find the most up-to-date technical documentation on the VMware Web site at: VMware Web site also provides the latest product you have comments about this documentation, submit your feedback 2008, 2009 VMware, Inc. All rights reserved. This product is protected by and international copyright and intellectual property laws. VMware products are covered by one or more patents listed at , the VMware boxes logo and design, Virtual SMP, and VMotion are registered trademarks or trademarks of VMware, Inc. in the United States and/or other jurisdictions. All other marks and names mentioned herein may be trademarks of their respective companies. VMware, ContentsAbout This Book 71vSphere CLI Installation , Execution, and Command Overviews 9 Installing and Using vSphere CLI Commands 9 Installing vSphere CLI and Running Commands on Linux 10 Unpacking and Installing the vSphere CLI Package 11 Running vSphere CLI Commands 11 Uninstalling the vSphere CLI Package 12 Installing vSphere CLI and Running Commands on Windows 12 Uninstalling the vSphere CLI Package 13 Installing vMA and Running Commands from vMA 13 Specifying Authentication Information 13 Order of Precedence 14 Using a Session File 14 Using Environment Variables 15 Using a Configuration File 15 Using Command Line Options 15 Using Microsoft Windows Security Support Provider Interface (SSPI)
2 16 Available Options for vSphere CLI Execution 16 Using vSphere CLI Commands in Scripts 18 List of Available Commands 19 Supported Platforms for Commands 20 Commands with an esxcfg Prefix 222vSphere CLI Reference 25 Storage Management Commands 25 Diagnostic Partition Management with vicfg dumppart 25 Basic Storage Array Management with vicfg mpath 27 NAS File System Management with vicfg nas 28 Available LUN Discovery with vicfg scsidevs 29 Rescan Operations with vicfg rescan 30 Networking Commands 31 DNS Configuration Specification with vicfg dns 31 Physical NIC Management with vicfg nics 32 NTP Server Specification with vicfg ntp 33 Route Entry Manipulation with vicfg route 34 VMkernel NICs Management with vicfg vmknic 35 Virtual Switch Management with vicfg vswitch 36 System Management Commands 39 Using resxtop for Performance Monitoring 39 Configuration Information Backup with vicfg cfgbackup 39 SNMP Management with vicfg snmp 40 Syslog Server Specification with vicfg syslog 41 Update Management with vihostupdate 42 Virtual Machine Management Commands 44 Virtual Machine Migration with svmotion 44vSphere Command-Line Interface Installation and Reference Guide4 VMware, Inc.
3 Miscellaneous Management Commands 46 Advanced Management with vicfg advcfg 46 VMkernel Module Manipulation with vicfg module 47 user and Group Management with vicfg user 48 Volume Management with vicfg volume 49 File System Manipulation with vifs 503 File System Management with vmkfstools 53vmkfstools Command Syntax 53 Supported Command Specific Options 54 Supported Targets 55 File System Target 55 Disk Partition Target 55 Device Target 55vmkfstools File System Options 55 VMFS File System Creation 55 Attribute Listing for a VMFS Volume 56 File System Partition Extension by Spanning 57vmkfstools Virtual Disk Options 57 Supported Disk Formats 57 Creating Virtual Disks 58 Initializing Virtual Disks 58 Inflating Thin Virtual Disks 59 Deleting Virtual Disks 59 Renaming Virtual Disk 59 Cloning Virtual or Raw Disks 59 Migrating VMware Workstation and VMware GSX Server Virtual Machines 60 Extending Virtual Disks 60 Creating Virtual Compatibility Mode Raw Device Mappings 61 Creating Physical Compatibility Mode Raw Device Mappings 61 Listing RDM Attributes 61 Displaying Virtual Disk Geometry 624iSCSI Storage Management with vicfg iscsi 63vicfg iscsi Command Syntax 63vicfg iscsi Options 64vicfg iscsi Discovery Target Options 67 Listing Dynamic or Static Discovery Targets 67 Adding Dynamic or Static Discovery Targets 67 Removing Dynamic or Static Discovery Targets 68vicfg iscsi Authentication Options 69 Listing Supported and Enabled Authentication Methods 69 Enabling Authentication 70 Enabling Mutual (Bidirectional)
4 Authentication 70 Returning Authentication to Default Inheritance 71vicfg iscsi Information Retrieval Options 71 External HBA Properties 71 Target Information 72 LUN Information 72vicfg iscsi Physical Network Portal Options 72 Listing Physical Network Portal Information 72 Setting Physical Network Portal Information 72vicfg iscsi Network Options 73 Listing Network Properties 73 Setting Network Properties 73 VMware, vicfg iscsi Initiator Options 73 Listing Initiator Properties 73 Setting Initiator iSCSI Name or Alias Name 74vicfg iscsi iSCSI Parameter Options 74 Listing iSCSI Parameter Options 74 Listing iSCSI Parameter Option Details 74 Setting iSCSI Parameter Options 75 Returning Parameters to Default Inheritance 75vicfg iscsi Software iSCSI Options 76 Listing Software iSCSI Loading Status 76 Enabling Software iSCSI 76 Disabling Software iSCSI 76 Tasks Required for Software iSCSI Setup 76 Tasks Required for Hardware iSCSI Setup 775 Virtual Machine Management with vmware cmd 79 Connection Options for vmware cmd 79 General Options for vmware cmd 80 Server Options for vmware cmd 80 Virtual Machine Options for vmware cmd 80 Soft and Hard Power Operations 82vmware cmd Examples 826 Storage Path and Storage Plugin Management with esxcli 83esxcli Command Syntax 83 Help for esxcli 84 Managing NMP with esxcli nmp 84 Device Management with esxcli nmp device 85esxcli nmp
5 Device list 85esxcli nmp device setpolicy 85 Fixed Path Selection Policy Operations with esxcli nmp fixed 85esxcli nmp fixed getpreferred 85esxcli nmp fixed setpreferred 86 Path Operations with esxcli nmp path 86esxcli nmp path list 86 PSP Operations with esxcli nmp psp 86esxcli nmp psp getconfig 86esxcli nmp psp list 87esxcli nmp psp setconfig 87 Round Robin Operations with esxcli nmp roundrobin 87esxcli nmp roundrobin getconfig 87esxcli nmp roundrobin setconfig 88 SATP Operations with esxcli nmp satp 88esxcli nmp satp addrule 88esxcli nmp satp deleterule 89esxcli nmp satp getconfig 89esxcli nmp satp list 89esxcli nmp satp listrules 90esxcli nmp satp setconfig 90esxcli nmp satp setdefaultpsp 90vSphere Command-Line Interface Installation and Reference Guide6 VMware, Inc. Using esxcli swiscsi nic for NIC Binding 90esxcli swiscsi nic add 90esxcli swiscsi nic remove 91esxcli swiscsi nic list 91 Path Claiming with esxcli corestorage claiming 91esxcli corestorage claiming reclaim 91esxcli corestorage claiming unclaim 92 Managing Claim Rules with esxcli corestorage claimrule 92esxcli corestorage claimrule add 93esxcli corestorage claimrule convert 94esxcli corestorage claimrule delete 95esxcli corestorage claimrule list 95esxcli corestorage claimrule load 95esxcli corestorage claimrule move 95esxcli corestorage claimrule run 96 Path Masking with esxcli corestorage claimrule 96 Appendix.
6 Commands for Managing Legacy Servers 99 Storage Array Configuration for VMware Infrastructure Systems with vicfg mpath35 99 Performing Maintenance on VMware Infrastructure Systems with vihostupdate35 101 Index 103 VMware, The vSphere Command Line Interface Installation and Reference Guide, explains how to install and use the VMware vSphere Command Line Interface ( vSphere CLI) and includes Reference documentation and examples for each command. The vSphere Command Line Interface Installation and Reference Guide covers ESX, ESXi, and vCenter Server. Chapter 1 explains how to install vSphere CLI and how to run vSphere CLI commands on Windows or Linux. The chapter also includes a Reference to connection options and other options you can use with each of the vSphere CLI commands. Chapter 2 provides Reference documentation for most of the vSphere CLI commands, organized by subject area. For each command, the chapter lists and discusses each option and gives examples. Chapters 3 6 provide Reference documentation for more complex vSphere CLI commands.
7 Chapter 3 discusses vmkfstools. It includes information about the command syntax, file system options, and virtual disk options. Chapter 4 discusses vicfg-iscsi, which you can use for iSCSI monitoring and management operations. Chapter 5 discusses vmware-cmd. It includes information about connection options, general options, server options, and virtual machine options. Chapter 6 discusses esxcli, which you can use to configure the Native Multipathing Plugin (NMP), the Pluggable Storage Architecture (PSA), and NIC bindings. Appendix A discusses the vihostupdate35 and vicfg-mpath35 legacy commands, which are available for ESX/ESXi systems. Intended AudienceThis book is for experienced Windows or Linux system administrators who are familiar with vSphere administration tasks and datacenter operations and know how to use commands in FeedbackVMware welcomes your suggestions for improving our documentation. If you have comments, send your feedback to This BookvSphere Command-Line Interface Installation and Reference Guide8 VMware, Inc.
8 Related DocumentationThe vSphere documentation consists of the combined VMware vCenter Server and ESX/ESXi documentation set. The documentation set contains background information for the commands discussed in this document. The vSphere SDK for Perl documentation explains how you can use the vSphere SDK for Perl and related utility applications to manage your vSphere environment and includes information about the vSphere SDK for Perl Utility Applications. The vSphere Management Assistant Guide explains how to install and use the vSphere Management Assistant (vMA). vMA is a virtual machine that includes the vSphere CLI and other prepackaged software. See Installing vMA and Running Commands from vMA on page 13. Technical Support and Education ResourcesThe following sections describe the technical support resources available to you. To access the current version of this book and other books, go to and Telephone SupportTo use online support to submit technical support requests, view your product and contract information, and register your products, go to with appropriate support contracts should use telephone support for the fastest response on priority 1 issues.
9 Go to OfferingsTo find out how VMware support offerings can help meet your business needs, go to Professional ServicesVMware Education Services courses offer extensive hands on labs, case study examples, and course materials designed to be used as on the job Reference tools. Courses are available onsite, in the classroom, and live online. For onsite pilot programs and implementation best practices, VMware Consulting Services provides offerings to help you assess, plan, build, and manage your virtual environment. To access information about education classes, certification programs, and consulting services, go to VMware, 1 The vSphere CLI command set allows you to run common system administration commands against ESX/ESXI systems from an administration server of your choice. You can run most vSphere CLI commands against a vCenter Server system and target any ESX/ESXi system that system manages. vSphere CLI commands are especially useful for ESXi hosts because they do not include a service console.
10 vSphere CLI commands run on top of the vSphere SDK for Perl. The vSphere CLI, vSphere SDK for Perl, and some prerequisite software are included in the Installation package on Windows and on supported Linux distributions. This chapter includes the following topics: Installing and Using vSphere CLI Commands on page 9 Installing vSphere CLI and Running Commands on Linux on page 10 Installing vSphere CLI and Running Commands on Windows on page 12 Installing vMA and Running Commands from vMA on page 13 Specifying Authentication Information on page 13 Available Options for vSphere CLI Execution on page 16 Using vSphere CLI Commands in Scripts on page 18 List of Available Commands on page 19 Supported Platforms for Commands on page 20 Commands with an esxcfg Prefix on page 22 Installing and Using vSphere CLI CommandsYou can install a vSphere CLI package on either Linux or Microsoft Windows, or deploy the vSphere Management Assistant (vMA). vSphere CLI packages You can install a vSphere CLI package on a physical or virtual machine, which could become the remote administration server for all ESX/ESXi hosts.