设为首页 收藏本站
查看: 879|回复: 0

[经验分享] OpenStack (2)

[复制链接]

尚未签到

发表于 2017-6-26 15:03:12 | 显示全部楼层 |阅读模式
  Installing OpenStack Image Service
  vagrant ssh controller
  sudo apt-get update
sudo apt-get -y install glance
  sudo apt-get update
sudo apt-get -y install glance-client
  Using an alternative release
  sudo apt-get update
sudo apt-get -y install python-software-properties
  sudo add-apt-repository ppa:openstack-ubuntu-testing/havana-trunk-testing
  Configuring OpenStack Image Service with MySQL
  vagrant ssh controller
  1. create the glance database
  MYSQL_ROOT_PASSWORD=openstack
mysql -uroot -p$MYSQL_ROOT_PASSWORD -e 'CREATE DATABASE glance;'
  2. create a glance user
  MYSQL_GLANCE_PASSWORD=openstack
mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '${MYSQL_GLANCE_PASSWORD}';"
mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '${MYSQL_GLANCE_PASSWORD}';"
  3. configure the OpenStack Image Service to use the database
  sudo sed -i "s,^sql_connection.*,sql_connection = mysql://glance:${MYSQL_DB_PASSWORD}@172.16.0.200/glance," /etc/glance/glance-{registry,api}.conf
  change the sql_connections line to match the database credentials.
  4. restart the glance-registry service
  sudo stop glance-registry
sudo start glance-registry
  5. restart the glance-api service
  sudo stop glance-api
sudo start glance-api
  6. glance database is versioned controlled under Ubuntu 12.04 to allow upgrade and downgrade of service.
  glance-manage version_control 0
  7. sync the database to ensure the correct table structure is present.
  sudo glance-manage db_sync
  Configuring OpenStack Image Service with OpenStack Identity Service
  vagrant ssh controller
  1. edit the /etc/glance/glance-api-paste.ini file and configure the [filter:authtoken] section
  [filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_
token:filter_factory
admin_tenant_name = service
admin_user = glance
admin_password = glance
  2. configure the /etc/glance/glance-api.conf file, to tell OpenStack Image Service to utilize OpenStack Identity Service
  [keystone_authtoken]
auth_host = 172.16.0.200
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance
  [paste_deploy]
config_file = /etc/glance/glance-api-paste.ini
flavor = keystone
  3. edit the /etc/glance/glance-registry-paste.ini file and configure the [filter:authtoken] section
  [filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_
token:filter_factory
admin_tenant_name = service
admin_user = glance
admin_password = glance
  4. configure the /etc/glance/glance-registry.conf file, to tell OpenStack Image Service to utilize OpenStack Identity Service
  [keystone_authtoken]
auth_host = 172.16.0.200
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = glance
  [paste_deploy]
config_file = /etc/glance/glance-registry-paste.ini
flavor = keystone
  5. restart the two OpenStack Image Service processes
  sudo restart glance-api
sudo restart glance-registry
  Managing images with OpenStack Image Service
  sudo apt-get update
sudo apt-get -y install glance-client
  export OS_TENANT_NAME=cookbook
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://172.16.0.1:5000/v2.0/
export OS_NO_CACHE=1
  uploading Ubuntu images
  1. download an Ubuntu cloud image
  wget http://uec-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img
  2. upload the cloud image
  glance image-create --name='Ubuntu 12.04 x86_64 Server' --disk-format=qcow2 --container-format=bare --public < precise-server-clouding-amd64-disk1.img
  listing images
  glance image-list
  viewing image details
  glance image-show IMAGE-ID
glance image-show 794dca52-5fcd-4216-ac8e-7655cdc88852
  deleting images
  glance image-delete IMAGE-ID
  making private images public
  When uploading an image, they get entered into OpenStack Image Service as private by default.
  1. list and view the image
  glance image-show IMAGE-ID
  2. convert to a public image
  glance image-update IMAGE-ID --is-public True
  3. issue a public glance listing
  glance image-show IMAGE-ID
  Registering a remotely stored image
  sudo apt-get update
sudo apt-get -y install glance-client
  export OS_TENANT_NAME=cookbook
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://172.16.0.200:5000/v2.0/
export OS_NO_CACHE=1
  1. register a remote virtual image into the environment
  glance image-create --name='Ubuntu 12.04 x86_64 Server' --disk-format=qcow2 --container-format=bare --public --locatin http://webserver/precise-server-clouding-amd64-disk1.img
  Sharing images among tenants
  sudo apt-get update
sudo apt-get -y install glance-client
  export OS_TENANT_NAME=cookbook
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://172.16.0.1:5000/v2.0/
export OS_NO_CACHE=1
  1. get the tenant ID
  keystone tenant-list
  2. list images
  glance image-list
  3. share the image
  glance member-create IMAGE-ID TENANT-ID
  Viewing shared images
  sudo apt-get update
sudo apt-get -y install glance-client
  export OS_TENANT_NAME=cookbook
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=http://172.16.0.1:5000/v2.0/
export OS_NO_CACHE=1
  1. get tenant ID
  keystone tenant-list
  2. list the images
  glance member-list --tenant-id TENANT-ID

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-388219-1-1.html 上篇帖子: OpenStack(企业私有云)万里长征第一步 下篇帖子: 创建 OVS Local Network
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表