官术网_书友最值得收藏!

Registering a remotely stored image

OpenStack Image Service provides a mechanism to remotely add an image that is stored at an externally accessible location. This allows for a convenient method of adding images we might want to on our private cloud that have been uploaded to an external third-party server.

Getting ready

To begin with, ensure you are logged in to our Ubuntu client where we can run the glance tool. This can be installed using the following command:

sudo apt-get update
sudo apt-get install python-glanceclient

Ensure that you have your environment variable set up correctly with our admin user and password, as created in the previous chapter:

export OS_TENANT_NAME=cookbook
export OS_USERNAME=admin
export OS_PASSWORD=openstack
export OS_AUTH_URL=https://192.168.100.200:5000/v2.0/
export OS_NO_CACHE=1
export OS_KEY=/vagrant/cakey.pem
export OS_CACERT=/vagrant/ca.pem

How to do it...

Carry out the following steps to remotely store an image in our OpenStack Image Service:

  1. To register a remote virtual image into our environment, we add a location parameter instead of streaming the image through a pipe on our glance command line:
    glance image-create \
     --name='Ubuntu 12.04 x86_64 Server' \
     --disk-format=qcow2 \
     --container-format=bare \
     --public \
     --location http://webserver/precise-server-cloudimg-amd64-disk1.img
    
  2. The preceding step returns information similar to what you can see here, which is then stored in our OpenStack Image Service:
    How to do it...

How it works...

Using the glance tool to specify remote images directly provides a quick and convenient way to add images to our OpenStack Image Service repository. The way this happens is with the location parameter. We add in our usual meta information to accompany this, as we would with a locally-specified image.

主站蜘蛛池模板: 合山市| 宁蒗| 大化| 安龙县| 页游| 黄大仙区| 田阳县| 营山县| 万州区| 开平市| 兴宁市| 柯坪县| 临武县| 敦化市| 临澧县| 东莞市| 卫辉市| 遂川县| 张家口市| 抚顺县| 巨鹿县| 苍南县| 瓮安县| 洛阳市| 高平市| 合山市| 鹿泉市| 清远市| 阳泉市| 广宁县| 库尔勒市| 潜江市| 景洪市| 徐水县| 海门市| 荥经县| 三门县| 咸宁市| 凭祥市| 防城港市| 肃南|