如果受影响的虚拟机也挂载有卷,那么先要生成一个实例和卷的UUID的列表:

select nova.instances.uuid as instance_uuid, cinder.volumes.id as volumes_uuid, cinder.volumes.status, cinder.volumes.attach_status, cinder.volumes.mountpoint, cinder.volumes.display_name from cinder.volumes inner join nova.instances on cinder.volumes.instance_uuid=nova.instances.uuid where nova.instances.host =  'compute24';

高版本有一个表专门连接实例uuid和卷uuid对应的:

nova volume-detach instance_uuid volume_uuid

nova volume-attach instance_uuid volume_uuid /dev/vdX

 

update instances set host = 'compute5' where host = 'compute6' and deleted = 0;

nova reboot --hard instance_uuid

 

nova host-evacuate --on-shared-storage compute24

nova service-disable compute24 nova-compute

 

 

计算节点故障:

use nova;

update instances set host='cco2.pp' where host='cco1.pp';

重启生成libvirt xml文件:

nova reboot --hard instance_id