1. vim-cmd命令 增加命令如下:
hot add a virtual disk to a virtual machine:
-
Connect to the host through SSH. For more information, see .
-
Run this command to get the VMID of the virtual machine you want to add the disk to:
vmware-vim-cmd vmsvc/getallvms
-
Run this command to hot add a disk to the virtual machine:
vmware-vim-cmd vmsvc/device.diskaddexisting vmid /vmfs/volumes/path to disk.vmdk 0 1
The
0 at the end represents the SCSI controller you want to add the disk to
and the 1 represents the SCSI target number, so if you already have a
SCSI0:0 disk, add the next disk as SCSI0:1 (0 1).
Note: Make sure you use an absolute path when specifying the VMDK. For ESXi, use the vim-cmd command.
2. 创建虚拟磁盘:
vim-cmd vmsvc/get.datastores + vimid 查看vim id的磁盘存储
vim-cmd vmsvc/device.diskadd 16 10000 scsi0 2 datastore1
This adds to vmid 16 a 10000 KB disk on the SCSI0 controller, as the
second disk (there is already a disk at the 1 position), to datastore1.
阅读(4141) | 评论(0) | 转发(0) |