If you add a disk that has been installed with an operating system (such as a disk that has been installed with a Windows system) to the vSphere Client, you cannot directly add a drive, you need to log on to the ESXi console through SSH.
Obtain disk device information:
# Esxcfg-scsidevs-l
Mpx. Vm1_32: C0: T0: L0
Device Type: Direct-Access
Size: 7580 MB
Display Name: Local USB Direct-Access (mpx. Vm1_32: C0: T0: L0)
Multipath Plugin: NMP
Console Device:/vmfs/devices/disks/mpx. Vm1_32: C0: T0: L0
Devfs Path:/vmfs/devices/disks/mpx. Vm1_32: C0: T0: L0
Vendor: HP iLO Model: Internal SD-CARD Revis: 2.09
SCSI Level: 2 Is Pseudo: false Status: on
Is RDM Capable: false Is Removable: true
Is Local: true Is SSD: false
Other Names:
Vml.0000000000766d68626133323a303a30
VAAI Status: unsupported
T10.ATA _____ plextor_px2d128m5s_________________________ p02349103954 ________
Device Type: Direct-Access
Size: 122104 MB
Display Name: Local ATA Disk (t10.ATA _____ plextor_px2d128m5s_________________________ p02349103954 ________)
Multipath Plugin: NMP
Console Device:/vmfs/devices/disks/t10.ATA _____ plextor_px2d128m5s_________________________p02349103954 ________
Devfs Path:/vmfs/devices/disks/t10.ATA _____ plextor_px2d128m5s_________________________p02349103954 ________
Vendor: ATA Model: PLEXTOR PX-128M5 Revis: 1.05
SCSI Level: 5 Is Pseudo: false Status: on
Is RDM Capable: false Is Removable: false
Is Local: true Is SSD: true
Other Names:
Vml1_0000000050303233343931303339353420202020202020504c4558544f
VAAI Status: unknown
T10.ATA _____ WDC_WD3200BEVT2D75ZCT2________________________WD2DWXE309HU6629
Device Type: Direct-Access
Size: 305245 MB
Display Name: Local ATA Disk (t10.ATA _____ wdc_wd3200bevt2d75zct2____________________________wd2dwxe309hu6629)
Multipath Plugin: NMP
Console Device:/vmfs/devices/disks/t10.ATA _____ WDC_WD3200BEVT2D75ZCT2________________________WD2DWXE309HU6629
Devfs Path:/vmfs/devices/disks/t10.ATA _____ WDC_WD3200BEVT2D75ZCT2________________________WD2DWXE309HU6629
Vendor: ATA Model: WDC WD3200BEVT-7 Revis: 11.0
SCSI Level: 5 Is Pseudo: false Status: on
Is RDM Capable: false Is Removable: false
Is Local: true Is SSD: false
Other Names:
Vml1_00000000202020202057442d5758453330394855363239574443205744
VAAI Status: unknown
Where t10.ATA _____ plextor_px2d128m5s_____________________________p02349103954 ________ is the hard disk installed on the Windows system and obtains its partition information:
~ # PartedUtil get/vmfs/devices/disks/t10.ATA _____ PLEXTOR_PX2D128M5S ___________
____________ P02349103954 ________
15566 255 63 250069680
1 2048 718847 7 128
2 718848 250069646 7 0
Delete partition:
~ # PartedUtil delete/vmfs/devices/disks/t10.ATA _____ PLEXTOR_PX2D128M5S ________
___________ P02349103954 ________ 1
~ # PartedUtil delete/vmfs/devices/disks/t10.ATA _____ PLEXTOR_PX2D128M5S ________
___________ P02349103954 ________ 2
After the disk is deleted, add a new disk to the vSphere Client.
Appendix esxcfg-scsidevs usage:
~ # Esxcfg-scsidevs-h
Esxcfg-scsidevs <options>
Print the mappings between vmhba names and/dev names
-L | -- list List all Logical Devices known on this
System with device information.
-C | -- compact-list List all Logical Devices each on
Single line, with limited information.
-U | -- uids List all Device Unique Identifiers with their primary name.
-D | -- device Used to filter the -- list, -- compact-list
And uids commands to limit output to
Specific device.
-M | -- vmfs Print mappings for VMFS volumes to their
Service Console partitions and vmhba names.
-F | -- vfat Print mappings for VFAT volumes to their
Service Console partitions and vmhba names.
-A | -- hbas Print HBA devices with identifying information
-A | -- hba-device-list Print a mapping between HBAs and the devices it
Provides paths.
-O | -- offline-cos-dev Offline the COS device corresponding to this vmkernel
Device.
-N | -- online-cos-dev Bring online the COS device corresponding to this vmkernel
Device.
-H | -- help Show this message.
Usage of the partedUtil tool:
~ # PartedUtil-h
Usage:
Get Partitions: get <diskName>
Set Partitions: set <diskName> ["partNum startSector endSector type attr"] *
Delete Partition: delete <diskName> <partNum>
Resize Partition: resize <diskName> <partNum> <start> <end>
Get Partitions: getptbl <diskName>
Set Partitions: setptbl <diskName> <label> ["partNum startSector endSector type/guid attr"] *
Fix Partition Table: fix <diskName>
Create New Label (all existing data will be lost): mklabel <diskName> <label>
Show commonly used partition type guids: showGuids
Get usable first and last sectors: getUsableSectors <diskName>
Fix GPT Table interactively: fixGpt <diskName>