OpenStack Learning Note Eight glance installation configuration

Source: Internet
Author: User

Mirroring a virtual hard disk that has a system installed

Management is done with glance.

Status of the Mirror:

The active image has been uploaded and is available

Saving is being uploaded, not yet completed.

Killed upload error

Queued does not actually upload, but is marked with this image

Installing glance

Register at Keystone

Glance the required account

Create a Glance Service

Specify the endpoint of the Glance Service



Installation

[[email protected] ~]# yum -y install openstack-glance.noarch[[email  protected] ~]# openstack-db  --init  --service glance --password  123456 -rootpw 123456[[email protected] ~ (keystone_admin)]# keystone user-create  --name glance  --pass 123456[[email protected] ~ (keystone_admin)]#  keystone  user-role-add  --user glance --tenant services --role  admin[[email protected] ~ (keystone_admin)]# keystone  service-create  -- name glance --type image  --description  "Glance jingxiang" [[email  protected] ~ (keystone_admin)]# keystone  endpoint-create  --service-id   3d0969b633044029a895da1ca2855464  --publicurl   ' http://192.168.1.204:9292 '    --internalurl   ' HTtp://192.168.1.204:9292 '   --adminurl   ' http://192.168.1.204:9292 ' +-------------+---------- ------------------------+|   property  |               Value                |+-------------+----------------------------------+|   adminurl   |    http://192.168.1.204:9292     | |       id     | e0f7718b18444f71a43762ca3336ef06  | |  internalurl |    http://192.168.1.204:9292     | |   publicurl  |    http://192.168.1.204:9292      | |     region   |             regionone             | |   service_id | 3d0969b633044029a895da1ca2855464 |+-------------+--------------------- -------------+


Modifying a configuration file

[[Email protected] glance (Keystone_admin)]# systemctl  list-unit-files  |  grep glancopenstack-glance-api.service                   disabled    Accept the user's request openstack-glance-registry.service              disabled    interacting with the database openstack-glance-scrubber.service              disabled    interacting with other interfaces [[email protected]  glance (keystone_admin)]# lsglance-api.conf    glance-registry.conf   metadefs     schema-image.jsonglance-cache.conf  glance-scrubber.conf   policy.json[[email protected] glance (keystone_admin)]# cd /usr/share/glance/template [[ Email protected] glance (keystone_admin)]# lsglanCe-api-dist.conf       glance-registry-dist.confglance-api-dist-paste.ini   glance-registry-dist-paste.iniglance-cache-dist.conf      Glance-scrubber-dist.conf[[email protected] glance (keystone_admin)]# cp  glance-api-dist.conf  /etc/glance/glance-api.conf # #拷贝模板
[[Email protected] glance (Keystone_admin)]# vim glance-api.conf[default]debug =  falseverbose = trueuse_stderr = falselog_file = /var/log/glance/ api.logfilesystem_store_datadir = /var/lib/glance/images/scrubber_datadir = /var/lib/ glance/scrubberimage_cache_dir = /var/lib/glance/image-cache/rabbit_host =  192.168.1.204rabbit_port = 5672rabbit_hosts =  $rabbit _host: $rabbit _portrabbit_use_ssl  = falserabbit_userid = guestrabbit_password = guestrabbit_login_method =  amqplain[database]connection = mysql://glance:[email protected]/glance[keystone_authtoken ]admin_tenant_name = servicesadmin_user = glanceadmin_password = 123456auth_host  = 192.168.1.204auth_port = 35357auth_protocol = httpauth_uri = http:/ /192.168.1.204:5000/[paste_deploy]config_file =&Nbsp;/usr/share/glance/glance-api-dist-paste.iniflavor = keystone 
[[email protected] glance]# chown root.glance glance-api.conf[[email protected] glance]# systemctl start Openstack-glanc E-api.service openstack-glance-registry.service Openstack-glance-scrubber.service[[email protected] glance]# Systemctl Enable Openstack-glance-api.service Openstack-glance-registry.service Openstack-glance-scrubber.service

Management

[[Email protected] ~ (Keystone_admin)]# glance image-list+----+------+| id |  name |+----+------+ +----+------+[[email protected] ~ (keystone_admin)]# glance  help  image-create######################### #先上传一个镜像再创建 [[Email protected] ~ (Keystone_admin) ]# glance   image-create  --name hequan --file hequan.img   --disk-format qcow2   --visibility publice  --container-format  bare             # #创建 [[email protected]  ~ (keystone_admin)]# glance   image-create  --name hequan -- os-distro http://mirrors.163.com/centos/7.2.1511/isos/x86_64/centos-7-x86_64-minimal-1511.iso   --disk-format iso     --container-format barefilesystem_store_datadir  = /var/lib/glance/images/ ## #镜像保存的位置   #default_store =file 

Modify the image storage location

Swift does back-end storage

  6  #filesystem_store_datadir  = /var/lib/glance/images/  # #先禁用 [Glance_store ]default_store = swift           Default to file  Change to swiftstores = file, http                  do not move swift_store_auth_version = 2       by default    Default version is 2stores=glance.store.swift.store,glance.store.filesystem.store        This must be added, or you will not be able to upload swift_store_auth_address = http://192.168.1.204:5000/v2.0/    Controller's Keystone authentication swift_store_user = service:swift     use Swift user swift_store_ key = hequan         Password swift_store_container =  glance         the container that will be created swift_store_create_container_on_put =  True         Upload Open swift_store_large_object_size = 5120          maximum 5G limit, but limited after binding with glance swift_store_large_object_chunk_size = 200          maximum of 200 containers swift_enable_snet = false[[email protected] glance ( Keystone_admin)]# systemctl restart openstack-glance-api.service  Openstack-glance-registry.service  openstack-glance-scrubber.service

Ceph shared storage

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/84/74/wKioL1eQyIXiJOY3AAExaGE5bbI635.png-wh_500x0-wm_3 -wmp_4-s_2011593954.png "title=" Image.png "alt=" Wkiol1eqyixijoy3aaexage5bbi635.png-wh_50 "/>

Installing the Epel Warehouse

RPM-VIH http://mirrors.sohu.com/fedora-epel/7/x86_64/e/epel-release-7-2.noarch.rpm add Yum ceph warehouse vim/etc/ Yum.repos.d/ceph.repo[ceph]name=ceph Noarch packagesbaseurl=http://mirrors.163.com/ceph/rpm-hammer/el7/x86_64/ ENABLED=1GPGCHECK=1TYPE=RPM-MDGPGKEY=HTTP://MIRRORS.163.COM/CEPH/KEYS/RELEASE.ASC Install Ceph-deploy, Ceph (Ceph All nodes are installed, Ceph-deploy only admin node installed) yum-y update && yum-y install--release Hammer ceph Ceph-deploy

1 Generating the relevant MOD information monitoring server h5

[Email protected] xx]# Ceph-deploy new h5[[email protected] xx]# lsceph.conf ceph-deploy-ceph.log ceph.mon.keyring

2 To modify the configuration file according to your own situation ceph.conf

Osd_pool_default_size = 2 # #几个节点组成, default is 3osd_pool_defaults_min_size = 1 # #最小值是1

3 Generate key when a client wants to link to a ceph server, a user name and password are required

[Email protected] xx]# Ceph-deploy mon create-initial[[email protected] myceph]# lsceph.bootstrap-mds.keyring ceph. Client.admin.keyring ceph.mon.keyringceph.bootstrap-osd.keyring ceph.confceph.bootstrap-rgw.keyring Ceph.log

4 Getting ready to configure the OSD

mkdir path1 path2[[email protected] xx]# ceph-deploy OSD prepare h5:/path1 h6:/path2[[email protected] xx]# Ceph-deploy OSD Activate h5:/path1 h6:/path2 # #激活 [Ceph_deploy.osd][debug] Host h5 is now ready for the OSD use.

5 Copy the key to each node

[[email protected] ceph]# Ceph-deploy admin h5 h6[[email protected] ceph]# ceph Health # #健康性检查

6 Generating Meta data

[[email protected] ceph]# Ceph-deploy MDS create H5[[email protected] ceph]# rados lspools[[email protected] ceph]# Rado s mkpool glance[[email protected] ceph]# Rados rmpool Glance Glance--yes-i-really-really-mean-it # #删除

Glance configured as a CEPH client

Installing Ceph

[[Email protected] ceph (keystone_admin)]# lsrbdmap[[email protected] myceph]# Ceph-deploy admin h4[[email protected] CEP H (keystone_admin)]# lsceph.client.admin.keyring ceph.conf rbdmap tmp6bxooyvim glance-api.conf[glance_store]default_ store = Rbdstores = Rbdrbd_store_pool = Glancerbd_store_user = adminrbd_store_ceph_conf =/etc/ceph/ceph.confrbd_store_ Chunk_size = 8 systemctl restart Openstack-glance-api.service openstack-glance-registry.service OPENSTACK-GLANCE-SCR UBBER.SERVICE-RW-------1 root root 63 July 16:43 ceph.client.admin.keyringsetfacl-m u:glance:r--ceph.client.admin. Keyring # #设置权限 can read

Make image   

yum -y groupinstall  "Server with gui" yum install virt-manager  PYTHON-VIRTINST QEMU-KVM-TOOLS   QEMU-KVM  LIBVIRTKVM Creating a storage volume      CENTOS.QCOW2 Basic Installation configuration NIC    remove Mac install basic components openssh-clientscloud-init   # #云包 [[email  protected] ~]# vim /etc/default/grubgrub_cmdline_linux= "Net.ifnames=0  biosdevname=0  console=tty0 console=ttys0,115200n8 rhgb quiet "# #指定串口的参数 [[email protected] ~]#  GRUB2-MKCONFIG  -O  /BOOT/GRUB2/GRUB.CFG package [[Email protected] ~]# yum  whatprovides */virt-sysprep[[email protected] ~]# yum -y install  Libguestfs-bash-completion-1.28.1-1.55.el7.centos.noarch[[email protected] ~]# virt-sysprep   -d centos[[email protected] ~]# cd /openstack-image/[[email  Protected] openstack-image]# qemu-img  info centos.qcow2qemu-img  conver -c -o qcow2   centos.qcow2   newcentos.qcow2 ## #3   Compression commands


This article is from the "what-all" blog, please be sure to keep this source http://hequan.blog.51cto.com/5701886/1828592

OpenStack Learning Note Eight glance installation configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.