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
Print HBA devices with identifying information.
vicfg-scsidevs <conn_options> --hbas
The return value includes the adapter ID, driver ID, adapter UID, PCI, vendor, and model.
n
Print a mapping between HBAs and the devices it provides paths to.
vicfg-scsidevs <conn_options> --hba-device-list
Detach a Device and Remove a LUN
Before you can remove a LUN, you must detach the corresponding device by using the vSphere Web Client,
or the esxcli storage core device set command.
Detaching a device brings a device oine. Detaching a device does not impact path states. If the LUN is still
visible, the path state is not set to dead.
Prerequisites
n
Make sure you are familiar with virtual machine migration. See the vCenter Server and Host Management
documentation.
n
Make sure you are familiar with datastore mounting and unmounting. See “Mount a Datastore with
ESXCLI,” on page 32.
Procedure
1 Migrate virtual machines from the device you plan to detach.
2 Unmount the datastore deployed on the device.
If the unmount fails, ESXCLI returns an error. If you ignore that error, you will get an error when you
aempt to detach a device with a VMFS partition still in use.
3 If the unmount failed, check whether the device is in use.
esxcli storage core device world list -d <device>
If a VMFS volume is using the device indirectly, the world name includes the string idle0. If a virtual
machine uses the device as an RDM, the virtual machine process name is displayed. If any other process
is using the raw device, the information is displayed.
4 Detach the storage device.
esxcli storage core device set -d naa.xxx... --state=off
Detach is persistent across reboots and device unregistration. Any device that is detached remains
detached until a manual aach operation. Rescan does not bring persistently detached devices back
online. A persistently detached device comes back in the o state.
ESXi maintains the persistent information about the device’s oine state even if the device is
unregistered. You can remove the device information by running esxcli storage core device
detached remove -d naa.12.
5 (Optional) To troubleshoot the detach operation, list all devices that were detached manually.
esxcli storage core device detached list
6 Perform a rescan.
esxcli <conn_options> storage core adapter rescan
vSphere Command-Line Interface Concepts and Examples
48 VMware, Inc.