XenServer, Glance and VHD image

asked 2011-06-16 15:54:05 -0600

ethuleau gravatar image

I use Nova revision 1186 on Ubuntu 10.04 with hypervisor XenServer 5.6. I set Glance (r139) to image service.

When I use a RAW disk format image, I can run instance from this image (fetching is ok). But If upload a VHD disk format image on Glance, I cannot start instance from this image.

Compute log says :

2011-06-16 17:19:42,014 AUDIT nova.compute.manager [-D5DJT9CEZKL05RQS1OY demo demo_project] instance 32: starting... 2011-06-16 17:19:42,246 DEBUG nova.rpc [-] Making asynchronous call on network.p-hs22-12 ... from (pid=29274) multicall /usr/lib/pymodules/python2.6/nova/rpc .py:475 2011-06-16 17:19:42,247 DEBUG nova.rpc [-] MSG_ID is 149c7082d7ca46c789901324bea3730c from (pid=29274) multicall /usr/lib/pymodules/python2.6/nova/rpc.py:478 2011-06-16 17:19:42,701 DEBUG nova.xenapi_net [-] ENTERING ensure_vlan_bridge in xenapi net from (pid=29274) ensure_vlan_bridge /usr/lib/pymodules/python2.6/ nova/network/xenapi_net.py:40 2011-06-16 17:19:43,374 DEBUG nova.virt.xenapi.vm_utils [-] Detected DISK_VHD format for image 39, instance 32 from (pid=29274) log_disk_format /usr/lib/pymo dules/python2.6/nova/virt/xenapi/vm_utils.py:526 2011-06-16 17:19:43,375 DEBUG nova.virt.xenapi.vm_utils [-] Asking xapi to fetch vhd image 39 from (pid=29274) _fetch_image_glance_vhd /usr/lib/pymodules/pyt hon2.6/nova/virt/xenapi/vm_utils.py:405

It blocks on "_fetch_image_glance_vhd" method and the instance stays in 'building' state. And on the XenServer, I can see the plugin 'glance' blocked :

<xenserver># ps -fe | grep glance

root 30802 30800 0 17:19 ? 00:00:00 python /etc/xapi.d/plugins/glance <methodcall><methodname>download_vhd</methodname><params><value>OpaqueRef:c67e7380-7072-b1a8-1c97-5d343a4fc216</value><value><struct><member><name>params</name><value>(dp0?S'image_id'?p1?S'39'?p2?sS'glance_host'?p3?S'p-novamaster.rd.francetelecom.fr'?p4?sS'sr_path'?p5?S'/var/run/sr-mount/37f98bc3-6a4d-c52b-658e-06c1b41b4172'?p6?sS'glance_port'?p7?I9292?sS'uuid_stack'?p8?(lp9?S'0cf13dc1-36d6-4753-90fb-a171fc9717d7'?p10?aS'f058da29-1cc9-466c-a657-a8ee30868b55'?p11?as.</value></member></struct></value></params></methodcall>

And in Glance log, I can see the GET command for my image (id 39) :

2011-06-16 12:48:36 DEBUG [glance.api.middleware.version_negotiation] Processing request: HEAD /v1/images/39 Accept: 2011-06-16 12:48:36 DEBUG [glance.api.middleware.version_negotiation] Matched versioned URI. Version: 1.0 2011-06-16 12:48:36 DEBUG [routes.middleware] Matched HEAD /images/39 2011-06-16 12:48:36 DEBUG [routes.middleware] Route path: '/images/{id}', defaults: {'action': u'meta', 'controller': <glance.api.v1.images.controller object="" at="" 0x1d57b90="">} 2011-06-16 12:48:36 DEBUG [routes.middleware] Match dict: {'action': u'meta', 'controller': <glance.api.v1.images.controller object="" at="" 0x1d57b90="">, 'id': u'39'} 2011-06-16 12:48:36 DEBUG [eventlet.wsgi.server] 10.193.175.209 - - [16/Jun/2011 12:48:36] "HEAD /v1/images/39 HTTP/1.1" 200 775 0.011884 2011-06-16 12:48:37 DEBUG [glance.api.middleware.version_negotiation] Processing request: GET /v1/images/39 Accept: 2011-06-16 12:48:37 DEBUG [glance.api.middleware.version_negotiation] Matched versioned URI. Version: 1.0 2011-06-16 12:48:37 DEBUG [routes.middleware] Matched GET /images/39 ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2011-06-22 09:32:00 -0600

ethuleau gravatar image

So, I found the matter. It's not easy without documentations.

To import a VHD image to Glance, the image must be archived and compressed in a specific format:

The VHD image MUST named 'image.vhd' and tarred/gziped : $ tar -cv image.vhd | gzip > image_vhd.tar.bz

If not, the XenAPI plugin 'Glance' fail and can block on the function '_download_tarball' and the session with Glance stay up.

After that you can upload the image to glance and instantiate it: $ glance add name="My VHD image" is_public=True disk_format=vhd container_format=ovf image_state=available < image_vhd.tar.bz

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2011-06-16 15:54:05 -0600

Seen: 152 times

Last updated: Jun 22 '11