openstack 설치 -- glance

4837 단어 openstack
자세히 보기
glance 데이터베이스 만들기
mysql -u root -p
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'GLANCE_DBPASS';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'GLANCE_DBPASS';
flush privileges

glance 사용자 만들기
openstack user create --domain default --password-prompt glance

서비스-project에서 glance 사용자를 위한 관리자 역할 만들기
openstack role add --project service --user glance admin

glance 서비스 만들기
openstack service create --name glance --description "OpenStack Image service" image

Create the Image service API endpoints:
openstack endpoint create --region RegionOne  image public http://controller: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 python-glance python-glanceclient

vim/etc/glance/glance-api.conf (이미 존재하는 파일)
[database]
...
connection = mysql://glance:GLANCE_DBPASS@controller/glance
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS

[paste_deploy]
...
flavor = keystone

[glance_store]
...
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

[DEFAULT]
...
notification_driver = noop
[DEFAULT]
...
verbose = True  //    ,   

vim/etc/glance/glance-registry.conf
[database]
...
connection = mysql://glance:GLANCE_DBPASS@controller/glance
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS

[paste_deploy]
...
flavor = keystone

[DEFAULT]
...
notification_driver = noop
[DEFAULT]
...
verbose = True //  

동기화glance 데이터베이스, 동기화 전glance 데이터베이스에 아무런 내용이 없음, 동기화 후 n장 테이블
su -s /bin/sh -c "glance-manage db_sync" glance //      glance   

glance 서비스 시작 시작 및 설정
systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service

환경 변수 증가
echo "export OS_IMAGE_API_VERSION=2" | tee -a admin-openrc.sh demo-openrc.sh

source admin-openrc.sh
glance 서비스가 성공적으로 설치되었는지 확인
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
 glance image-create --name "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress
glance image-list

glance 명령
[root@station140 ~(keystone_admin)]# glance help  | grep image  
              [--os-image-url OS_IMAGE_URL] [-U OS_IMAGE_URL]  
              [--os-image-api-version OS_IMAGE_API_VERSION]  
    add                 DEPRECATED! Use image-create instead.  
    delete              DEPRECATED! Use image-delete instead.  
    details             DEPRECATED! Use image-list instead.  
    image-create        Create a new image.  
    image-delete        Delete specified image(s).  
    image-download      Download a specific image.  
    image-list          List images you can access.  
    image-members       DEPRECATED! Use member-list instead.  
    image-show          Describe a specific image.  
    image-update        Update a specific image.  
    index               DEPRECATED! Use image-list instead.  
    member-create       Share a specific image with a tenant.  
    member-delete       Remove a shared image from a tenant.  
    member-images       DEPRECATED! Use member-list instead.  
    member-list         Describe sharing permissions by image or tenant.  
    show                DEPRECATED! Use image-show instead.  
    update              DEPRECATED! Use image-update instead.

좋은 웹페이지 즐겨찾기