6.5
Table Of Contents
- vSphere Command-Line Interface Concepts and Examples
- Contents
- About This Book
- vSphere CLI Command Overviews
- Introduction
- List of Available Host Management Commands
- Targets and Protocols for vCLI Host Management Commands
- Supported Platforms for vCLI Commands
- Commands with an esxcfg Prefix
- ESXCLI Commands Available on Different ESXi Hosts
- Trust Relationship Requirement for ESXCLI Commands
- Using ESXCLI Output
- Connection Options for vCLI Host Management Commands
- Connection Options for DCLI Commands
- vCLI Host Management Commands and Lockdown Mode
- Managing Hosts
- Managing Files
- Managing Storage
- Introduction to Storage
- Examining LUNs
- Detach a Device and Remove a LUN
- Reattach a Device
- Working with Permanent Device Loss
- Managing Paths
- Managing Path Policies
- Scheduling Queues for Virtual Machine I/O
- Managing NFS/NAS Datastores
- Monitor and Manage FibreChannel SAN Storage
- Monitoring and Managing Virtual SAN Storage
- Monitoring vSphere Flash Read Cache
- Monitoring and Managing Virtual Volumes
- Migrating Virtual Machines with svmotion
- Configuring FCoE Adapters
- Scanning Storage Adapters
- Retrieving SMART Information
- Managing iSCSI Storage
- iSCSI Storage Overview
- Protecting an iSCSI SAN
- Command Syntax for esxcli iscsi and vicfg-iscsi
- iSCSI Storage Setup with ESXCLI
- iSCSI Storage Setup with vicfg-iscsi
- Listing and Setting iSCSI Options
- Listing and Setting iSCSI Parameters
- Enabling iSCSI Authentication
- Set Up Ports for iSCSI Multipathing
- Managing iSCSI Sessions
- Managing Third-Party Storage Arrays
- Managing Users
- Managing Virtual Machines
- Managing vSphere Networking
- Introduction to vSphere Networking
- Retrieving Basic Networking Information
- Troubleshoot a Networking Setup
- Setting Up vSphere Networking with vSphere Standard Switches
- Setting Up Virtual Switches and Associating a Switch with a Network Interface
- Retrieving Information About Virtual Switches
- Adding and Deleting Virtual Switches
- Checking, Adding, and Removing Port Groups
- Managing Uplinks and Port Groups
- Setting the Port Group VLAN ID
- Managing Uplink Adapters
- Adding and Modifying VMkernel Network Interfaces
- Managing VMkernel Network Interfaces with ESXCLI
- Add and Configure an IPv4 VMkernel Network Interface with ESXCLI
- Add and Configure an IPv6 VMkernel Network Interface with ESXCLI
- Managing VMkernel Network Interfaces with vicfg-vmknic
- Add and Configure an IPv4 VMkernel Network Interface with vicfg-vmknic
- Add and Configure an IPv6 VMkernel Network Interface with vicfg-vmknic
- Setting Up vSphere Networking with vSphere Distributed Switch
- Managing Standard Networking Services in the vSphere Environment
- Setting the DNS Configuration
- Manage an NTP Server
- Manage the IP Gateway
- Setting Up IPsec
- Manage the ESXi Firewall
- Monitor VXLAN
- Monitoring ESXi Hosts
- Index
Command Description Target Syntax
--get
-g <remote_path>
<local_path>
Downloads a le from the ESXi host to the
machine on which you run vCLI. This
operation uses HTTP GET.
Datastore
Host
get src_dstore_file_path
dst_local_file_path
get src_d store_dir_path
dst_local_file_path
--listdc
-C
Lists the data center paths available on an
ESXi system.
Datastore
Host
--listds
-S
Lists the datastore names on the ESXi system.
When multiple data centers are available, use
the --dc (-Z) argument to specify the name of
the data center from which you want to list
the datastore.
Datastore
Host
vifs --listds
--mkdir
-M <remote_dir>
Creates a directory in a datastore. This
operation fails if the parent directory of
dst_datastore_file_path does not exist.
Datastore
Temp
mkdir dst_directory_path
--move
-m <source>
<target>
Moves a le in a datastore to another location
in a datastore. The <source> must be a
remote source path, the <target> a remote
target path or directory.
The --force option replaces existing
destination les.
Datastore
Temp
move src_file_path
dst_directory_path [--
force]
move src_file_path
dst_file_path [--force]
--put
-p <local_path>
<remote_path>
Uploads a le from the machine on which you
run vCLI to the ESXi host. This operation uses
HTTP PUT.
This command can replace existing host les
but cannot create new les.
Datastore
Host Temp
put src_local_file_path
dst_file_path
put src_local_file_path
dst_directory_path
--rm
-r <remote_path>
Deletes a datastore le. Datastore
Temp
rm dst_file_path
--rmdir
-R <remote_dir>
Deletes a datastore directory. This operation
fails if the directory is not empty.
Datastore
Temp
rmdir dst_directory_path
vifs Examples
You can use vifs to interact with the remote ESXi or vCenter Server system in a variety of ways.
Specify one of the connection options listed in “Connection Options for vCLI Host Management
Commands,” on page 19 in place of <conn_options>.
N The examples illustrate use on a Linux system. You must use double quotes instead of single quotes
when on a Windows system.
Listing Remote Information
n
List all data centers on a vCenter Server system with --listdc, using --server to point to the
vCenter Server system.
vifs --server <my_vc>--username administrator --password <pswd> --listdc
n
List all datastores on a vCenter Server system with --listds.
vifs --server <my_vc> --username administrator --password <pswd> --dc kw-dev --listds
n
List all datastores on an ESXi host with --listds.
vifs --server <my_ESXi> --username root --password <pswd> --listds
The command lists the names of all datastores on the specied server.
Chapter 3 Managing Files
VMware, Inc. 37