• openstack 部署笔记--glance


    控制节点

    创建用户及服务

    $ . admin-openrc
    
    $ openstack user create --domain default --password-prompt glance
    $ openstack role add --project service --user glance admin
    $ openstack service create --name glance 
      --description "OpenStack Image" image
    
    $ openstack endpoint create --region RegionOne 
      image public http://controller.cn:9292
      
    $ openstack endpoint create --region RegionOne 
      image internal http://controller:9292
      
    $ openstack endpoint create --region RegionOne 
      image admin http://controller:9292
    

    配置glance

    # yum install openstack-glance
    
    # vim /etc/glance/glance-api.conf
    [database]
    # ...
    connection = mysql+pymysql://glance:root@controller/glance
    [keystone_authtoken]
    # ...
    auth_uri = http://controller:5000
    auth_url = http://controller:35357
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = glance
    password = root
    
    [paste_deploy]
    # ...
    flavor = keystone
    
    [glance_store]
    # ...
    stores = file,http
    default_store = file
    filesystem_store_datadir = /var/lib/glance/images/
    
    # vim /etc/glance/glance-registry.conf
    [database]
    # ...
    connection = mysql+pymysql://glance:root@controller/glance
    [keystone_authtoken]
    # ...
    auth_uri = http://controller:5000
    auth_url = http://controller:35357
    memcached_servers = controller:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = glance
    password = root
    
    [paste_deploy]
    # ...
    flavor = keystone
    

    同步数据库

    # su -s /bin/sh -c "glance-manage db_sync" glance
    
    # systemctl enable openstack-glance-api.service 
      openstack-glance-registry.service
    # systemctl start openstack-glance-api.service 
      openstack-glance-registry.service
    

      

    验证配置

    $ . admin-openrc
    $ wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
    $ openstack image create "cirros" 
      --file cirros-0.3.5-x86_64-disk.img 
      --disk-format qcow2 --container-format bare 
      --public
    
    $ openstack image list
    
    +--------------------------------------+--------+--------+
    | ID                                   | Name   | Status |
    +--------------------------------------+--------+--------+
    | 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros | active |
    +--------------------------------------+--------+--------+
    

      

      

  • 相关阅读:
    平时用到的Linux命令
    angular.element方法汇总
    CSS display:inline-block
    CSS:position:fixed使用(转)
    常见浏览器兼容性问题与解决方案【转】
    部分浏览器兼容问题
    php对应js math.random
    php stdclass转数组
    写在2016年末
    VirtualBox中Ubuntu 14.04屏幕分辨率不能设置的问题
  • 原文地址:https://www.cnblogs.com/37yan/p/6934350.html
Copyright © 2020-2023  润新知