openstack中如何修改regionname


好多環境部署時會走默認的region名字 RegionOne 但是有的環境如果多套openstack一起納管,就會有修改region name的需求

否則多套會因為重名而沖突

修改步驟有一下幾步

1.修改數據庫

use keystone;

insert into region (id,description,parent_region_id,extra) values('Regiontwo','',NULL,'{}');  #插入一張新名稱的region表 此regiontwo為中間過渡的表

update endpoint set region_id='Regiontwo' where region_id='RegionOne'; #把所有regionone的endpoint信息改成新的region two。

update  region set id='RegionThree' where id='RegionOne'; #將目標修改的region名稱替換RegionThree

update endpoint set region_id='RegionThree' where region_id='Regiontwo'; 

delete from region where id='Regiontwo'; #更新完成后將中間過渡表刪除;

 

 

修改完成后再次查詢端口會出現如下報錯

[root@kvm-cy-06 ~]# openstack endpoint list
admin endpoint for identity service in RegionOne region not found

還要修改admin_openrc.sh環境變量腳本中的region為替換過的name

# vim admin-openrc.sh

# source admin-openrc.sh

  

第一步大功告成

2.修改所有服務配置文件中的region_name

# sed -i 's/RegionOne/RegionThree/g' /etc/nova/*.conf

# sed -i 's/RegionOne/RegionThree/g' /etc/glance/*.conf

# sed -i 's/RegionOne/RegionThree/g' /etc/neutron/*.conf 

#sed -i 's/RegionOne/RegionThree/g' /etc/cinder/*.conf

保守起見再檢查一遍

 

修改完成

3.重啟所有修改后的服務

# systemctl |egrep '(nova|glance|neutron|cinder)' |awk '{print $1}' |xargs systemctl restart 

至此,整套環境的regionname修改完成

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM