← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1649232] [NEW] Broken OVA Import on VMwareVCDriver

 

Public bug reported:

If a user places an OVA on Glance with its own storage independent of
the VCenter, the import fails in nova with not finding the file in the
vmware_temp directory.


I am using mitaka on a VCenter 6.0, but looking at the code, I would say it affects also liberty and later versions, when the Glance isn't storing the images directly in the VCenter (e.g Swift store)

I created an OVA image in Glance (Swift backed), and then started a VM with the image.
The import fails with a missing file.

Essentially, the code is broken here:
https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vmops.py#L620-L629

`image_prepare` creates some temporary directory, which is never used in
`image_fetch` aka `_fetch_image_as_ova`, and `image_cache` expects the
imported image there.

However, the function `_fetch_image_as_ova` imports the OVA as a VM,
which places the root disk in a folder named as the imported image name.


Attached is a patch, which makes the `_fetch_image_as_ova` function move the image to the cache directory, and changes the `image_prepare` and `image_cache` function to a noop.

** Affects: nova
     Importance: Undecided
         Status: New

** Patch added: "0001-Fix-import-of-OVAs-with-VMwareVCDriver.patch"
   https://bugs.launchpad.net/bugs/1649232/+attachment/4790617/+files/0001-Fix-import-of-OVAs-with-VMwareVCDriver.patch

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1649232

Title:
  Broken OVA Import on VMwareVCDriver

Status in OpenStack Compute (nova):
  New

Bug description:
  If a user places an OVA on Glance with its own storage independent of
  the VCenter, the import fails in nova with not finding the file in the
  vmware_temp directory.

  
  I am using mitaka on a VCenter 6.0, but looking at the code, I would say it affects also liberty and later versions, when the Glance isn't storing the images directly in the VCenter (e.g Swift store)

  I created an OVA image in Glance (Swift backed), and then started a VM with the image.
  The import fails with a missing file.

  Essentially, the code is broken here:
  https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vmops.py#L620-L629

  `image_prepare` creates some temporary directory, which is never used
  in `image_fetch` aka `_fetch_image_as_ova`, and `image_cache` expects
  the imported image there.

  However, the function `_fetch_image_as_ova` imports the OVA as a VM,
  which places the root disk in a folder named as the imported image
  name.

  
  Attached is a patch, which makes the `_fetch_image_as_ova` function move the image to the cache directory, and changes the `image_prepare` and `image_cache` function to a noop.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1649232/+subscriptions