I dig a little and there is something that I don't understand. The function _fetch_vhd_image() returns a list of dictionaries that describe VDIs. So for example if I have a disk like this one:
At 1225, for my case, the file 7e65ebc1-ac4a-4c35-b66d-73af3d5451c6.vhd has been copied in the SR and vdis = {'root': {'uuid': '7e65ebc1-ac4a-4c35-b66d-73af3d5451c6'}}.
When the SR.scan is ran, it creates the vdi shows previously (with the uuid=46a...). So shouldn't we update the vdis after the scan of the SR?
I dig a little and there is something that I don't understand. The function _fetch_vhd_image() returns a list of dictionaries that describe VDIs. So for example if I have a disk like this one:
# xe vdi-list 52a8-0010- 4751-ad2e553844 0e
name- label ( RW): 7e65ebc1- ac4a-4c35- b66d-73af3d5451 c6.vhd description ( RW):
sr- uuid ( RO): 1d0018c1- 808b-4205- ba69-3ed1806d68 39
virtual- size ( RO): 42025472
sharable ( RO): false
read- only ( RO): false
uuid ( RO) : 46addb2a-
name-
If the disk is the root of the VM, the corresponding VDIs should be something like vdis={'root': {'uuid': '46addb2a- 52a8-0010- 4751-ad2e553844 0e'}}
When I look the following piece of code in _fetch_vhd_image():
1222 handler. download_ image( sr(session)
1223 vdis = default_
1224 context, session, instance, image_id)
1225
1226 sr_ref = safe_find_
1227 _scan_sr(session, sr_ref)
1228
At 1225, for my case, the file 7e65ebc1- ac4a-4c35- b66d-73af3d5451 c6.vhd has been copied in the SR and vdis = {'root': {'uuid': '7e65ebc1- ac4a-4c35- b66d-73af3d5451 c6'}}.
When the SR.scan is ran, it creates the vdi shows previously (with the uuid=46a...). So shouldn't we update the vdis after the scan of the SR?