vmware 虛擬機硬碟擴容指南
很多時候,我們建立一個虛擬機的時候,並不知道這個虛擬機確切需要的硬碟容量。當運行了一陣以後發現原有的硬碟容量不足的時候,麻煩就來了。可以添加新的硬碟到虛擬機,但是原來的分區可能沒法擴展到新的物理硬碟上(特別是windows平台的系統分區)。難道,我們只能夠重建一個新的虛擬機,按照新的配置要求重新配置所有的軟體和系統么?這個時候就如果能夠對原有的虛擬硬碟擴容,然後利用一些分區調整軟體來擴展分區,那麼所有的問題就都迎刃而解了。
幸運的是vmware提供了一個工具,可以完成上述功能 ---- vmware-vdiskmanager.exe
C:\Program Files\VMware\VMware Server>vmware-vdiskmanager.exe
VMware Virtual Disk Manager - build 29996.
Usage: vmware-vdiskmanager.exe OPTIONS diskName | drive-letter:
Offline disk manipulation utility
Options:
-c : create disk; need to specify other create options
-d : defragment the specified virtual disk
-k : shrink the specified virtual disk
-n <source-disk> : rename the specified virtual disk; need to
specify destination disk-name
-p : prepare the mounted virtual disk specified by
the drive-letter for shrinking
-q : do not log messages
-r <source-disk> : convert the specified disk; need to specify
destination disk-type
-x <new-capacity> : expand the disk to the specified capacity
Additional options for create and convert:
-a <adapter> : (for use with -c only) adapter type (ide, buslogic o
r lsilogic)
-s <size> : capacity of the virtual disk
-t <disk-type> : disk type id
Disk types:
0 : single growable virtual disk
1 : growable virtual disk split in 2Gb files
2 : preallocated virtual disk
3 : preallocated virtual disk split in 2Gb files
The capacity can be specified in sectors, Kb, Mb or Gb.
The acceptable ranges:
ide adapter :
scsi adapter:
ex 1: vmware-vdiskmanager.exe -c -s 850Mb -a ide -t 0 myIdeDisk.vmdk
ex 2: vmware-vdiskmanager.exe -d myDisk.vmdk
ex 3: vmware-vdiskmanager.exe -r sourceDisk.vmdk -t 0 destinationDisk.vm
dk
ex 4: vmware-vdiskmanager.exe -x 36Gb myDisk.vmdk
ex 5: vmware-vdiskmanager.exe -n sourceName.vmdk destinationName.vmdk
ex 6: vmware-vdiskmanager.exe -k myDisk.vmdk
ex 7: vmware-vdiskmanager.exe -p m:
(A virtual disk first needs to be mounted at m:
using the VMware Diskmount Utility.)
利用這個工具,我們就可以直接將原來的虛擬機硬碟擴容,這個相當於物理硬碟的容量增加了。然後我們再相應的調整上面的分區大小,原先系統上的軟體,系統配置一樣都不用變,就可以順利使用新的資源了。
《解決方案》
PQ據說也支持虛擬機:mrgreen: