Comment 10 for bug 1222847

Revision history for this message
guillaume thouvenin (guillaume-thouvenin) wrote : Re: xenapi: Fetched VDIs of type 'root' with a wrong UUID

Sorry to insist but I don't see how it can work. I probably miss something but in the function _fetch_vhd_image(), first we download the vhd image in the repository that corresponds to the SR. So after

  vdis = handler.download_image(context, session, instance, image_id)

vdis contains the name of the file. Not the UUID of the vdi that will be created when we will invoke the sr-scan. So at this point we send a request to glance to download the image and it is stored in the directory:

# ls /usr/share/xapi/images
951e5aa6-7ef6-43ad-8edd-79edb4ad428e.vhd

the value of vdis is: vdis = 'root': {'uuid': '951e5aa6-7ef...-79edb4ad428e'}}

and the VHD is not seen yet by the SR in Xen.

  The next step is to scan the SR so we will be able to see the VHD file. The result is that the UUID is attributed to the disk and we can see it now:

# xe vdi-list
 uuid ( RO) : acd06ed8-dacf-7b8d-4f95-c5d835691383
          name-label ( RW): 951e5aa6-7ef6-43ad-8edd-79edb4ad428e.vhd
    name-description ( RW):
             sr-uuid ( RO): 106ab117-5431-0931-889b-6c534cd061c6
        virtual-size ( RO): 2299062272
            sharable ( RO): false
           read-only ( RO): false

but the content of vdis is always the same. So I don't understand how we can retrieve information of a disk wih UUID=951e5aa6-7ef6-43ad-8edd-79edb4ad428e from Xen. The UUID seems invalid.

I tried to go deeper but I'm lost when _call_glance_plugin() is called. Don't hesitate to ask for more information. I can get some trace from pdb or things like that.