• openstack(三)glance


    yum install -y openstack-glance

    /etc/glance/glance-api.conf 

    cat > /etc/glance/glance-api.conf  << EOF
    [database]
    connection= mysql+pymysql://glance:glance@192.168.3.220/glance
    
    [keystone_authtoken]
    auth_uri = http://192.168.3.220:5000
    auth_url = http://192.168.3.220:35357
    memcached_servers = 192.168.3.220:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = glance
    password = glance
    
    [paste_deploy]
    flavor=keystone
    
    [glance_store]
    stores = file,http
    default_store=file
    filesystem_store_datadir=/var/lib/glance/images/
    EOF
    glance-api.conf

    /etc/glance/glance-registry.conf 

    cat > /etc/glance/glance-registry.conf  << EOF
    [database]
    connection= mysql+pymysql://glance:glance@192.168.3.220/glance
    
    [keystone_authtoken]
    auth_uri = http://192.168.3.220:5000
    auth_url = http://192.168.3.220:35357
    memcached_servers = 192.168.3.220:11211
    auth_type = password
    project_domain_name = default
    user_domain_name = default
    project_name = service
    username = glance
    password = glance
    
    [paste_deploy]
    flavor=keystone
    
    EOF
    glance-registry.conf 

    初始化glance库

    su -s /bin/sh -c "glance-manage db_sync" glance

    查看表

    mysql -uglance -pglance -e "use glance;show tables;"

    启动并配置开机启动

    systemctl restart openstack-glance-api openstack-glance-registry &&  systemctl enable openstack-glance-api openstack-glance-registry 

    keystone主机要加入服务和端点

    openstack service create --name glance --description "OpenStack Image"    image
    openstack endpoint create --region RegionOne image public http://192.168.3.220:9292
    openstack endpoint create --region RegionOne image internal http://192.168.3.220:9292
    openstack endpoint create --region RegionOne image admin http://192.168.3.220:9292 
    View Code

    上传镜像(使用admin权限/上传镜像/列出镜像)

    source /root/admin-openstack && openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public && openstack image list

  • 相关阅读:
    浅谈管道模型(Pipeline)
    经常使用的webservice接口
    2012年终总结
    【Linux】linux经常使用基本命令
    php:兄弟连之面向对象版图形计算器1
    学习selenium所须要具备的技术
    Sftp和ftp 差别、工作原理等(汇总ing)
    对数据分布进行可视化的方法
    FusionCharts简单教程(一)---建立第一个FusionCharts图形
    闭包和柯里化
  • 原文地址:https://www.cnblogs.com/Leaders543/p/12731133.html
Copyright © 2020-2023  润新知