http://blog.youkuaiyun.com/weiyuanke/article/details/8562123
1) hostname 以及hosts文件
(2)libvirt的配置 以及权限
def migrate_disk_and_power_off ( self , context , instance , dest ,instance_type , network_info ,block_device_info = None ):LOG . debug ( _ ( "Starting migrate_disk_and_power_off" ),instance = instance )disk_info_text = self . get_instance_disk_info ( instance [ 'name' ])disk_info = jsonutils . loads ( disk_info_text )self . power_off ( instance )block_device_mapping = driver . block_device_info_get_mapping (block_device_info )for vol in block_device_mapping :connection_info = vol [ 'connection_info' ]mount_device = vol [ 'mount_device' ] . rpartition ( "/" )[ 2 ]self . volume_driver_method ( 'disconnect_volume' ,connection_info ,mount_device )# copy disks to destination# rename instance dir to +_resize at first for using# shared storage for instance dir (eg. NFS).same_host = ( dest == self . get_host_ip_addr ())inst_base = libvirt_utils . get_instance_path ( instance )inst_base_resize = inst_base + "_resize"try :utils . execute ( 'mv' , inst_base , inst_base_resize )if same_host :dest = Noneutils . execute ( 'mkdir' , '-p' , inst_base )else :utils.execute('ssh', dest, 'mkdir', '-p', inst_base) //需确保各主机之间可以无密码登陆for info in disk_info :# assume inst_base == dirname(info['path'])