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
n
100 – No heartbeat. Guest operating system might have stopped responding.
N You usually use the vmware-cmd guestinfo option only when VMware Support instructs you to do
so. The command is therefore not discussed in this document.
Managing Virtual Machine Snapshots with vmware-cmd
You can manage virtual machine snapshots by using vmware-cmd. A snapshot captures the entire state of the
virtual machine at the time you take the snapshot.
Virtual machine state includes the following aspects of the virtual machine.
n
Memory state - Contents of the virtual machine's memory.
n
Seings state - Virtual machine seings.
n
Disk state - State of all the virtual machine's virtual disks.
When you revert to a snapshot, you return these items to the state they were in at the time that you took the
snapshot. If you want the virtual machine to be running or to be shut down when you start it, make sure
that it is in that state when you take the snapshot.
You can use snapshots as restoration points when you install update packages, or during a branching
process, such as installing dierent versions of a program. Taking snapshots ensures that each installation
begins from an identical baseline. The vSphere Virtual Machine Administration documentation discusses
snapshots in detail.
I Use the vSphere Web Client to revert to a named snapshot. vmware-cmd only supports reverting
to the current snapshot.
Take a Virtual Machine Snapshot
You can take virtual machine snapshots by using vmware-cmd.
You can take a snapshot while a virtual machine is running, shut down, or suspended. If you are in the
process of suspending a virtual machine, wait until the suspend operation has nished before taking a
snapshot.
If a virtual machine has multiple disks in dierent disk modes, you must shut down the virtual machine
before taking a snapshot. For example, if you have a special-purpose conguration that requires you to use
an independent disk, you must shut down the virtual machine before taking a snapshot.
Procedure
1 (Optional) If the virtual machine has multiple disks in dierent disk modes, shut down the virtual
machine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost
<esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx stop soft
2 (Optional) Check that the shut down operation has been completed.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost
<esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx getstate
3
Run vmware-cmd with the createsnapshot option.
You must specify the description, quiesce ag (0 or 1) and memory ag (0 or 1).
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost
<esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx createsnapshot VM1Aug09 'test snapshot
August 09' 0 0
Chapter 8 Managing Virtual Machines
VMware, Inc. 127