| 1 | [[PageOutline]] |
| 2 | |
| 3 | = How to convert VMDK to Xen image = |
| 4 | |
| 5 | == STEP 1: convert VMDK to RAW image == |
| 6 | |
| 7 | === Method 1: use vmware-vdiskmanager command === |
| 8 | |
| 9 | * If you installed vmware server edition, there should be a command named '''vmware-vdiskmanager'''. You can use '''vmware-vdiskmanager''' to convert several vmdk image into one vmdk image and raw image. |
| 10 | {{{ |
| 11 | VMware Virtual Disk Manager - build 44356. |
| 12 | Usage: vmware-vdiskmanager OPTIONS diskName |
| 13 | Offline disk manipulation utility |
| 14 | Options: |
| 15 | -c : create disk; need to specify other create options |
| 16 | -d : defragment the specified virtual disk |
| 17 | -n <source-disk> : rename the specified virtual disk; need to |
| 18 | specify destination disk-name |
| 19 | -q : do not log messages |
| 20 | -r <source-disk> : convert the specified disk; need to specify |
| 21 | destination disk-type |
| 22 | -x <new-capacity> : expand the disk to the specified capacity |
| 23 | |
| 24 | Additional options for create and convert: |
| 25 | -a <adapter> : (for use with -c only) adapter type (ide, buslogic or lsilogic) |
| 26 | -s <size> : capacity of the virtual disk |
| 27 | -t <disk-type> : disk type id |
| 28 | |
| 29 | Disk types: |
| 30 | 0 : single growable virtual disk |
| 31 | 1 : growable virtual disk split in 2Gb files |
| 32 | 2 : preallocated virtual disk |
| 33 | 3 : preallocated virtual disk split in 2Gb files |
| 34 | |
| 35 | The capacity can be specified in sectors, Kb, Mb or Gb. |
| 36 | The acceptable ranges: |
| 37 | ide adapter : [100.0Mb, 950.0Gb] |
| 38 | scsi adapter: [100.0Mb, 950.0Gb] |
| 39 | ex 1: vmware-vdiskmanager -c -s 850Mb -a ide -t 0 myIdeDisk.vmdk |
| 40 | ex 2: vmware-vdiskmanager -d myDisk.vmdk |
| 41 | ex 3: vmware-vdiskmanager -r sourceDisk.vmdk -t 0 destinationDisk.vmdk |
| 42 | ex 4: vmware-vdiskmanager -x 36Gb myDisk.vmdk |
| 43 | ex 5: vmware-vdiskmanager -n sourceName.vmdk destinationName.vmdk |
| 44 | |
| 45 | }}} |