XenAPINFS - Integrated with Glance

1:20 PM
XenAPINFS - Integrated with Glance -

Introduction

This blog entry shows the XenAPINFS - integrating Glance. The plane of the device can be found on the dashboard. At the time of this writing, the driver supports one type XenServer ovf pictures (these pictures are specially appointed vhd files compressed at a .tgz archive). Concrete driver uses plugins xenapi nova download / upload images. I am also working on a general case, to be able to create volumes from images in arbitrary format (like qcow or gross). If you want to try XenAPINFS, make sure that the fix for this bug already hit the trunk, or cherry pick the patch

In this demo, I will :.

  • create a volume from an image view
  • start an instance of the volume set
  • make changes to the file system
  • download volume to look like a new image
  • create instances based on the newly created image

Requirements

NFS server

for the demo, one Ubuntu VM is in the service of NFS. The following options were specified for export:

  ubuntu @ copper: ~ $ grep demo / etc / exports / demo * (rw, no_subtree_check, no_root_squash)  

XenServer with OpenStack

for Devstack demo was used to install an OpenStack development on XenServer 6.1. For the demonstration, a single XenServer was used, however, it is possible to use a totally different XenServer for clinker operations. The only requirement is that Nova plugins must be installed on the XenServer used for volume operations (the one specified in cinder.conf )

.. Step 1 - Cinder set

Cinder must be configured to use XenAPINFS driver. I will show two ways to do it.

Change the configuration file directly

To set clinker, go to the OpenStack box, and edit the configuration file / etc / slag / ash conf and make sure the following items are there:

  = volume_driver cinder.volume.drivers.xenapi.sm.XenAPINFSDriver xenapi_connection_url = http: //epun.eng.hq.xensource .com xenapi_connection_username = xenapi_connection_password = root password = xenapi_nfs_server copper.eng.hq.xensource.com xenapi_nfs_serverpath = / demo  

After changing the configuration of ashes, make sure the service is restarted.

use devstack configure Cinder

You can also use devstack to configure clinker with XenAPINFS. The variables needed to localrc file are:

  = CINDER_DRIVER XenAPINFS CINDER_XENAPI_CONNECTION_URL = "epun.eng.hq.xensource.com" CINDER_XENAPI_CONNECTION_USERNAME CINDER_XENAPI_CONNECTION_PASSWORD = root = "password" CINDER_XENAPI_NFS_SERVER = "copper.eng.hq.xensource.com" CINDER_XENAPI_NFS_SERVERPATH = "/ demo"  

After adding these lines to your localrc file, re-stacking your environment:

  stack DevStackOSDomU @: ~ / $ devstack ./unstack.sh battery DevStackOSDomU @: ~ / $ devstack ./stack.sh  

please note that 'doing this, you are wiping, and consolidation of your new installation of OpenStack

Step 2. -. Add image

A Cirros image is provided via our github account. This image is already XenServer format. To download:

  battery DevStackOSDomU @: ~ $ cd devstack / battery DevStackOSDomU @: ~ / $ devstack. OpenRC administration battery DevStackOSDomU @: ~ / $ devstack create picture look --name demoimage  --copy-from = https: //github.com/downloads/citrix-openstack/warehouse/cirros-0.3.0-x86_64-disk. vhd.tgz  --container format = ovf --disk-vhd format =  

sure to give enough time to look to store the image. Wait until

  battery DevStackOSDomU @: ~ / $ devstack look picture-list  

shows that demoimage is assets

  ... demoimage | vhd | ovf | 92018 | assets |  

Step 3 - Create a volume from an image

First, get the ID of the new image:

  battery DevStackOSDomU @: ~ / $ devstack glance the picture-show demoimage | grep id  

and use it to create a volume 1G on the basis of this image, called demovolume_a

  battery @DevStackOSDomU: ~ $ clinker create --display_name = "demovolume_a" --image-id =  1  

Initially, volume status will be Download and as this operation is completed, it becomes available . Check its status with:

  battery DevStackOSDomU @: ~ $ ashes list  

Step 4. - Boot issue an instance of

To start a for example, first we need the identifier of the volume:

  show clinker demovolume_a | grep "id"  

and create a new instance with this volume as the primary hard drive:

  battery DevStackOSDomU @: ~ $ nova boot --flavor = m1. VDA small to --block_device_mapping =  ::: 0 demo_vm  

Use to access the horizon of the new virtual machine console, and log in using the usual Cirros credentials, and touch a file in the directory home. We expect to see these changes in the image created thereafter.

  $ touch HereIam $ sync  

And use nova to close the proceedings.

  stack DevStackOSDomU @: ~ $ nova delete   

Step 5 - Create an image from the volume

  battery DevStackOSDomU @: ~ $ clinker download the --container -to-size image = ovf --disk-vhd format =  demoimage_b  

Check the status of the picture, by:

  @DevStackOSDomU battery: ~ $ glance the picture-show demoimage_b  

and wait until assets

Step 6 - Start an instance of Uploaded image [

first, get the ID of the newly created image:

  stack @ DevStackOSDomU: ~ $ glance the picture-show demoimage_b | grep id  

and start an instance with this:

  battery DevStackOSDomU @: ~ $ nova boot --flavor = m1.small --image demoimage_b demo_vm_2 =  

horizon and use to connect and verify the contents of the home directory:

  $ ls | grep HereIam HereIam  
Previous
Next Post »
0 Komentar