Create Virtual machines linked clone on vSphere 5
VM的Linked Clone可以提高数据重用率,节省大量存储空间,提高部署时效,目前在vSphere ESXi里不支持直接创建Linked Clone,在vSphere ESXi中有两种实现Linked Clone的方法,一种是通过vCloud ,一种是通过vSphere web services SDK,SDK也有两种创建Linked Clone的方式,一种是以VM快照为原始数据盘,一种是以VM的当前状态为原始数据盘,两种方式的目的都是一样的,就是保护原始VMDK文件不被修改。
NOTE:官方建议一台VM不超过8个Linked Clone,要不然会产生严重的性能问题,同时对HA Clusters中的主机数量也有要求,如果一个HA Clusters有8台以上的主机,在HA迁移的时候,Linked Clone的VM可能会启动失败,所以建议在不超过8台主机的HA Clusters环境里配置Linked Clone
一、首先要安装vSphere web services SDK环境,在我的博客里有详细的教程
http://blog.csdn.net/jack161641/article/details/8705058
二、打开CMD,切换到C:\devprojects\SDK\vsphere-ws\java\JAXWS\
三、创建VM快照
run.bat com.vmware.vm.VMSnapshot --url [webserviceurl] --username [username] --password [password] --vmname [vmname] --operation create --description [Description of the snapshot]
Parameters: url [required] : url of the web service. username [required] : username for the authentication password [required] : password for the authentication vmname [required] : Name of the virtual machine operation [required] : operation type - [list|create|remove|revert] snapshotname [optional] : Name of the snapshot description [optional] : description of the sanpshot removechild [optional] : remove snapshot children - [1 | 0]
四、创建Linked Clone
run.bat com.vmware.vm.VMLinkedClone --url [webserviceurl] --username [username] --password [password] --vmname [myVM] --snapshotname [snapshot name] --clonename [clone name]
Parameters: url [required] : url of the web service username [required] : username for the authentication password [required] : password for the authentication vmname [required] : Name of the virtual machine snapshotname [required] : Name of the snaphot clonename [required] : Name of the cloneName