说明:如果vSphere上的VM使用虚拟硬盘是scsi接口,需要安装virtio模块,并加载,如果是ide则不需要安装。(如果ide接口安装并加载virtio到系统后,在openstack中同样无法启动!!!)
一、安装模块
/sbin/dracut–force–verbose–add-drivers"virtio virtio_ring virtio_pci"/boot/initramfs-3.10.0-327.el7.x86_64.img 3.10.0-327.el7.x86_64
modprobe virio
modprobe virtio_pci
二、使用voftool工具从VSphere Center导出ovf模板
1.从此地址下载http://ftp.tucha13.net/pub/software/VMware-ovftool-4.1.0/VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle
2.添加权限chmod a+x VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle
3.安装工具./VMware-ovftool-4.1.0-2459827-lin.x86_64.bundle.
4.导出虚拟机ovf模板
[root compute04 5_126]#ovftool–disableVerification–noSSLVerify–powerOffSource vi://user:password ip/path/to/Resources/05.xxxx/5.126-xxxx1-centos7 5_126.ovf
Opening VI source:vi://administrator%40vc.com ip/path/to/Resources/05.xxxxxx5.126-xxxxxx1-centos7
Powering off VM:5.126-1-centos7
Opening OVF target:5_126.ovf
Writing OVF package:5_126.ovf
Transfer Completed
Completed successfully
[root compute04 5_126]#ls
5_126-disk1.vmdk 5_126-disk2.vmdk 5_126.mf 5_126.ovf
三、创建卷
1、创建系统卷
说明:所创建卷的大小一定在大于等于vm硬盘
create–display-name 5_126_os 20
±-------------------------------±-------------------------------------+
|Property|Value|
±-------------------------------±-------------------------------------+
|p_w_uploads|[]|
|availability_zone|nova|
|bootable|false|
|consistencygroup_id|None|
|created_at|2017-04-01T06:16:33.000000|
|description|None|
|encrypted|False|
|id|2be0eaee-ca53-4d03-96a4-caae1c011a55|
|metadata|{}|
|migration_status|None