Welcome to Halil Demirezen's Tips and Tutorials Page
Personal
Home
Contact
Biography
Research

Projects
Tutorials
Celsus Library (TR)

Categories

LinuxNetworkComputer VisionDatabasesProgramming
vmware


Adding Disk from ESX CLI 2021-02-18 09:19:43

To add disk from command line,

1) Go to the directory where you would like to add disk (datastore path)

cd /vmfs/volumes/volumename



2) Create vmdk (size and name in the example)

vmkfstools --createvirtualdisk 200GB --diskformat thin centos7-disk-fails.vmdk


3) Get vmid which you attach the disk to

vim-cmd vmsvc/getallvms


4) Attach disk to that virtual machine

vim-cmd vmsvc/device.diskaddexisting 785 /vmfs/volumes//centos7-disk-fails.vmdk 0 2


The last values "0 2" show the SCSI bus and channel number. Please change / increment accordingly
until you do not get fail