首先先使用“nova delete”命令删除所有实例,释放磁盘空间。
停止nova服务:
service libvirtd stop
service openstack-nova-compute stop
清空目录:
rm -rf /var/lib/nova/instances/*
挂载NFS:
mount 168.5.22.100:/instances /var/lib/nova/instances
chown -R nova:nova /var/lib/nova/instances
chmod 755 /var/lib/nova/instances
修改fstab文件:
vi /etc/fstab
添加:
168.5.22.100:/instances /var/lib/nova/instances nfs defaults 0 0
备份配置文件:
cp -a /etc/nova/nova.conf /etc/nova/nova.conf.bak
cat /etc/nova/nova.conf.bak|grep -v ‘#‘|grep -v ‘^$‘>/etc/nova/nova.conf
修改配置文件:
[libvirt]
...
disk_cachemodes="file=directsync,block=none"
改为:
disk_cachemodes="file=none,block=none"
启动nova服务:
service libvirtd start
service openstack-nova-compute start
测试动态迁移实例:
nova live-migration 6a8e949c-66d1-460d-a2fa-c16473b70953 node-5.evecom.net
时间: 2024-10-22 21:29:51