Ubuntu 管理心得

搜尋此網誌

2018年8月8日 星期三

Convert vmdk for using in ESXi

The vmdk file, e.g, created in vmware workstation, cannot be directlt used in ESXi. It needs to be converted. The process is:
  1. Enable ssh connection in ESXi host.
  2. ssh to ESXi host, e.g. ssh -l root 192.168.1.110
  3. cd to the directory containing the vmdk file, e.g.
    cd /vmfs/volumes/62169753-c96da716/vmdk
  4. Suppose the vmdk file is ubuntu.vmdk, and let the converted vmdk filename be ubuntu_convert.vmdk. Then issue the command,
    vmkfstools -i ubuntu.vmdk ubuntu_convert.vmdk -d thin
  5. It will show something like:
    ...
    Clone: 100% done.
    It does not mean thee conversion is really finished. Just wait until the shell returns prompt, e.g. [root@chiao-dell:/vmfs/volumes/62169753-c96da716/vmdk]
  6. Usually, it will take couple of hours to finish for large file, YES! H.O.U.R.S. !
  7. If the datastore in on an nfs server, e.g. 192.168.1.8, then get into the nfs directory and use the following command to display the converted file size.
    ls -lsh ubunut_convert-flat.vmdk
    You will see something like this line:
    2.0G -rw------- 1 myuid mygid 510G  8月  8 16:27 ubuntu_convert-flat.vmdk
    Keep running this command, the size at the front is increasing. 

網誌存檔