openstack 虚拟机迁移时应注意的问题

13 篇文章 0 订阅

http://blog.csdn.net/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 = None
                 utils . 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'])
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值