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

[经验分享] [OpenStack] OpenStack Essex

[复制链接]

尚未签到

发表于 2015-4-11 14:59:05 | 显示全部楼层 |阅读模式
  









Glance
  Install glance using the following command:

sudo apt-get install glance glance-api glance-client glance-common glance-registry python-glance
运行结果:
localadmin@OpenStack-1:~$ sudo apt-get install glance glance-api glance-client glance-common glance-registry python-glance
[sudo] password for localadmin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libyaml-0-2 python-amqplib python-anyjson python-dateutil python-kombu python-xattr python-yaml
Suggested packages:
  python-amqplib-doc python-boto python-couchdb python-kombu-doc python-pymongo
The following NEW packages will be installed:
  glance glance-api glance-client glance-common glance-registry libyaml-0-2 python-amqplib python-anyjson python-dateutil python-glance python-kombu python-xattr
  python-yaml
0 upgraded, 13 newly installed, 0 to remove and 3 not upgraded.
Need to get 649 kB of archives.
After this operation, 3,709 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrors.163.com/ubuntu/ precise/main libyaml-0-2 amd64 0.1.4-2 [56.9 kB]
Get:2 http://mirrors.163.com/ubuntu/ precise/main python-amqplib all 1.0.0+ds-1 [34.5 kB]
Get:3 http://mirrors.163.com/ubuntu/ precise/main python-anyjson all 0.3.1-1build1 [7,208 B]
Get:4 http://mirrors.163.com/ubuntu/ precise/main python-dateutil all 1.5-1 [54.2 kB]
Get:5 http://mirrors.163.com/ubuntu/ precise/main python-kombu all 1.4.3-1 [94.1 kB]
Get:6 http://mirrors.163.com/ubuntu/ precise/main python-xattr amd64 0.6.2-1ubuntu1 [13.9 kB]
Get:7 http://mirrors.163.com/ubuntu/ precise/main python-yaml amd64 3.10-2 [122 kB]
Get:8 http://mirrors.163.com/ubuntu/ precise-proposed/main python-glance all 2012.1-0ubuntu2.1 [229 kB]
Get:9 http://mirrors.163.com/ubuntu/ precise-proposed/main glance-common all 2012.1-0ubuntu2.1 [6,506 B]
Get:10 http://mirrors.163.com/ubuntu/ precise-proposed/main glance-api all 2012.1-0ubuntu2.1 [12.1 kB]
Get:11 http://mirrors.163.com/ubuntu/ precise-proposed/main glance-registry all 2012.1-0ubuntu2.1 [4,700 B]
Get:12 http://mirrors.163.com/ubuntu/ precise-proposed/main glance all 2012.1-0ubuntu2.1 [1,742 B]
Get:13 http://mirrors.163.com/ubuntu/ precise-proposed/main glance-client all 2012.1-0ubuntu2.1 [10.8 kB]
Fetched 649 kB in 10s (64.0 kB/s)
Selecting previously unselected package libyaml-0-2.
(Reading database ... 52116 files and directories currently installed.)
Unpacking libyaml-0-2 (from .../libyaml-0-2_0.1.4-2_amd64.deb) ...
Selecting previously unselected package python-amqplib.
Unpacking python-amqplib (from .../python-amqplib_1.0.0+ds-1_all.deb) ...
Selecting previously unselected package python-anyjson.
Unpacking python-anyjson (from .../python-anyjson_0.3.1-1build1_all.deb) ...
Selecting previously unselected package python-dateutil.
Unpacking python-dateutil (from .../python-dateutil_1.5-1_all.deb) ...
Selecting previously unselected package python-kombu.
Unpacking python-kombu (from .../python-kombu_1.4.3-1_all.deb) ...
Selecting previously unselected package python-xattr.
Unpacking python-xattr (from .../python-xattr_0.6.2-1ubuntu1_amd64.deb) ...
Selecting previously unselected package python-yaml.
Unpacking python-yaml (from .../python-yaml_3.10-2_amd64.deb) ...
Selecting previously unselected package python-glance.
Unpacking python-glance (from .../python-glance_2012.1-0ubuntu2.1_all.deb) ...
Selecting previously unselected package glance-common.
Unpacking glance-common (from .../glance-common_2012.1-0ubuntu2.1_all.deb) ...
Selecting previously unselected package glance-api.
Unpacking glance-api (from .../glance-api_2012.1-0ubuntu2.1_all.deb) ...
Selecting previously unselected package glance-registry.
Unpacking glance-registry (from .../glance-registry_2012.1-0ubuntu2.1_all.deb) ...
Selecting previously unselected package glance.
Unpacking glance (from .../glance_2012.1-0ubuntu2.1_all.deb) ...
Selecting previously unselected package glance-client.
Unpacking glance-client (from .../glance-client_2012.1-0ubuntu2.1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Setting up libyaml-0-2 (0.1.4-2) ...
Setting up python-amqplib (1.0.0+ds-1) ...
Setting up python-anyjson (0.3.1-1build1) ...
Setting up python-dateutil (1.5-1) ...
Setting up python-kombu (1.4.3-1) ...
Setting up python-xattr (0.6.2-1ubuntu1) ...
Setting up python-yaml (3.10-2) ...
Setting up python-glance (2012.1-0ubuntu2.1) ...
Setting up glance-common (2012.1-0ubuntu2.1) ...
Adding system user `glance' (UID 109) ...
Adding new user `glance' (UID 109) with group `glance' ...
Not creating home directory `/var/lib/glance'.
Setting up glance-api (2012.1-0ubuntu2.1) ...
glance-api start/running, process 2001
Setting up glance-registry (2012.1-0ubuntu2.1) ...
glance-registry start/running, process 2053
Setting up glance (2012.1-0ubuntu2.1) ...
Setting up glance-client (2012.1-0ubuntu2.1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place












Glance Configuration
  Glance uses SQLite by default. MySQL and PostgreSQL can also be configured to work with Glance.
  Open /etc/glance/glance-api-paste.ini and at the end of the file, edit the following lines:

admin_tenant_name = %SERVICE_TENANT_NAME%
admin_user = %SERVICE_USER%
admin_password = %SERVICE_PASSWORD%

  These values have to be modified as per the configurations made earlier. The admin_tenant_name will be 'service', admin_user will be 'glance' and admin_password is 'glance'.
  After editing, the lines should be as follows:

admin_tenant_name = service
admin_user = glance
admin_password = glance

  Now open /etc/glance/glance-registry-paste.ini and make similar changes at the end of the file.
  Open the file /etc/glance/glance-registry.conf and edit the line which contains the option "sql_connection =" to this:

sql_connection = mysql://glancedbadmin:glancesecret@192.168.26.128/glance
  In order to tell glance to use keystone for authentication, add the following lines at the end of the file.

[paste_deploy]
flavor = keystone

  Open /etc/glance/glance-api.conf and add the following lines at the end of the document.

[paste_deploy]
flavor = keystone

  Create glance schema in the MySQL database.:

sudo glance-manage version_control 0
sudo glance-manage db_sync

  Restart glance-api and glance-registry after making the above changes.

sudo restart glance-api
sudo restart glance-registry
  Export the following environment variables.

   export SERVICE_TOKEN=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL="http://localhost:5000/v2.0/"
export SERVICE_ENDPOINT=http://localhost:35357/v2.0

  Alternatively, you can add these variables to ~/.bashrc.
  To test if glance is setup correectly execute the following command.

glance index
  The above command will not return any output. The output of the last command executed can be known from its return code - echo $?. If the return code is zero, then glance is setup properly and connects with Keystone.
  With glance configured properly and using keystone as the authentication mechanism, now we can upload images to glance. This has been explained in detail in "Image Management" chapter.




  localadmin@OpenStack-1:~$ glance
Usage: glance  [options] [args]
  Commands:
  help   Output help for one of the commands below
  add             Adds a new image to Glance
  update          Updates an image's metadata in Glance
  delete          Deletes an image from Glance
  index           Return brief information about images in Glance
  details         Return detailed information about images in
                    Glance
  show            Show detailed information about an image in
                    Glance
  clear           Removes all images and metadata from Glance
  
Member Commands:
  image-members    List members an image is shared with
  member-images    List images shared with a member
  member-add       Grants a member access to an image
  member-delete    Revokes a member's access to an image
  members-replace  Replaces all membership for an image
  Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  --silent-upload       disable progress bar animation and information during
                        upload
  -v, --verbose         Print more verbose output
  -d, --debug           Print more verbose output
  -H ADDRESS, --host=ADDRESS
                        Address of Glance API host. Default: 0.0.0.0
  -p PORT, --port=PORT  Port the Glance API host listens on. Default: 9292
  --ssl                 Use SSL when talking to Glance API host
  -U URL, --url=URL     URL of Glance service. This option can be used to
                        specify the hostname, port and protocol (http/https)
                        of the glance server, for example -U
                        https://localhost:9292/v1 Default: None. If given,
                        this option will override settings for --host, --port,
                        and --ssl.
  -k, --insecure        Explicitly allow glance to perform "insecure" SSL
                        (https) requests. The server's certificate will not be
                        verified against any certificate authorities. This
                        option should be used with caution.
  -A TOKEN, --os_auth_token=TOKEN, --auth_token=TOKEN
                        Authentication token to use to identify the client to
                        the glance server.  --auth_tokenis deprecated and will
                        be removed
  -I USER, --os_username=USER
                        User name used to acquire an authentication token
  -K PASSWORD, --os_password=PASSWORD
                        Password used to acquire an authentication token
  -R REGION, --os_region_name=REGION
                        Region name. When using keystone authentication
                        version 2.0 or later this identifies the region name
                        to use when selecting the service endpoint. A region
                        name must be provided if more than one region endpoint
                        is available
  -T TENANT, --os_tenant_name=TENANT
                        Tenant name
  -N AUTH_URL, --os_auth_url=AUTH_URL
                        Authentication URL
  -S STRATEGY, --os_auth_strategy=STRATEGY
                        Authentication strategy (keystone or noauth)
  --limit=LIMIT         Page size to use while requesting image metadata
  --marker=MARKER       Image index after which to begin pagination
  --sort_key=KEY        Sort results by this image attribute.
  --sort_dir=[desc|asc]
                        Sort results in this direction.
  -f, --force           Prevent select actions from requesting user
                        confirmation
  --dry-run             Don't actually execute the command, just print output
                        showing what WOULD happen.
  --can-share           Allow member to further share image.

运维网声明 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-56036-1-1.html 上篇帖子: openstack笔记 下篇帖子: 对比解析开源云平台:Eucalyptus VS OpenStack
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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