openstack云主机 跨项目迁移
1、面板或者后台修改网络类型为共享网络
openstack network set xxxxxxx --share
2、备份数据库
docker exec -it -u root mariadb mysqldump -uroot -pxxxxxxxxxxx nova instances > nova_instances.sql docker exec -it -u root mariadb mysqldump -uroot -pxxxxxxxxxxx nova instance_info_caches > nova_instance_info_caches.sql docker exec -it -u root mariadb mysqldump -uroot -pxxxxxxxxxxx cinder volumes > cinder_volumes.sql docker exec -it -u root mariadb mysqldump -uroot -pxxxxxxxxxxx neutron ports > neutron_ports.sql
3、查找原来项目的user_id和project_id,并记录下来
openstack user list --long openstack project list --long
4、查找目标项目的user_id和project_id
openstack user list --long openstack project list --long
5、修改数据库
mysql> update nova.instances set user_id="xxxxxxx",project_id="xxxxxxxx" where project_id="XXXXXXX"; mysql> update cidner.volumes set user_id="xxxxxxx",project_id="xxxxxxxx" where project_id="XXXXXXX"; mysql> update neutron.ports set user_id="xxxxxxx",project_id="xxxxxxxx" where project_id="XXXXXXX";
6、将导出来的nova.instance_info_caches.sql导出来,进行修改替换project_id 为目标项目id。
//将数据库表导入 docker cp nova_instance_info_caches.sql mariadb:/opt/ mysql> use nova; mysql[nova]>source /opt/nova_instance_info_caches.sql
6、面板上验证云主机是否迁移成功
相关推荐
gokeibi 2020-01-24
zziyuann 2020-06-12
gokeibi 2020-05-07
gokeibi 2020-04-19
gokeibi 2020-04-19
aliuge 2020-03-25
jmppok 2020-03-25
hhphhp 2020-02-09
hhphhp 2020-01-02
hutiewei00 2013-06-07
Moolightshadow 2020-07-16
fyggzb 2020-07-05
gokeibi 2020-06-12
fyggzb 2020-06-12
hhphhp 2020-06-12
fyggzb 2020-06-10
JeremyLiu 2020-06-10