Failed to download images from vmware glance datastore to compute datastore

Bug #1552610 reported by Felix Ma
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Radoslav Gerganov

Bug Description

Openstack version: Kilo.

We are configuring openstack/vmware w/ multiple datastore.
We also applied this patch: https://review.openstack.org/#/c/186716/

But we got an error when booting instances.

What we do:
1. Configure glance-store backend as vsphere
2. Create an image in glance. It is stored in vsphere://172.20.2.38/folder/openstack_glance/58f446bb-35da-4aca-9532-c33c8562e2c2?dcPath=IDC_Test&dsName=LUN03-00
3. Boot an instance with this image.

We failed at Step-3:
2016-03-02 18:37:19.941 14897 DEBUG nova.virt.vmwareapi.ds_util [req-6d3819a8-d5f8-406a-aa5c-0da4e4f26bf6 4412e38ec9814b96a03e63097ec51f1a 8f75187cd29f4715881f450646fc6e08 - - -] Copying the datastore file from [LUN03-00] openstack_glance/58f446bb-35da-4aca-9532-c33c8562e2c2 to [LUN03-02] vmware_temp/e3e50103-da69-44bb-910d-0ecaaba77c78/58f446bb-35da-4aca-9532-c33c8562e2c2/tmp-sparse.vmdk file_copy /usr/lib/python2.7/site-packages/nova/virt/vmwareapi/ds_util.py:239
7c78/58f446bb-35da-4aca-9532-c33c8562e2c2/tmp-sparse.vmdk file_copy /usr/lib/python2.7/site-packages/nova/virt/vmwareapi/ds_util.py:239
….
2016-03-02 18:37:20.480 14897 TRACE oslo_vmware.common.loopingcall FileNotFoundException: \u627e\u4e0d\u5230\u6587\u4ef6 [LUN03-02] vmware_temp/e3e50103-da69-44bb-910d-0ecaaba77c78/58f446bb-35da-4aca-9532-c33c8562e2c2/

There is no e3e50103-da69-44bb-910d-0ecaaba77c78 under [LUN03-02] vmware_temp.

Radoslav Gerganov confirms nova/virt/vmwareapi/vmops.py has a bug:

    def _prepare_sparse_image(self, vi):
        tmp_dir_loc = vi.datastore.build_path(
                self._tmp_folder, uuidutils.generate_uuid())
        tmp_image_ds_loc = tmp_dir_loc.join(
                vi.ii.image_id, "tmp-sparse.vmdk")
        return tmp_dir_loc, tmp_image_ds_loc

should be:

def _prepare_sparse_image(self, vi):
    tmp_dir_loc = vi.datastore.build_path(
            self._tmp_folder, uuidutils.generate_uuid())
    tmp_image_ds_loc = tmp_dir_loc.join(
            vi.ii.image_id, "tmp-sparse.vmdk")
    ds_util.mkdir(self._session, tmp_image_ds_loc.parent, vi.dc_info.ref)
    return tmp_dir_loc, tmp_image_ds_loc

This issue is gone after we make the changes.

Tags: vmware
Changed in nova:
importance: Undecided → Low
assignee: nobody → Radoslav Gerganov (rgerganov)
tags: added: vmware
Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/289269

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Radoslav Gerganov (rgerganov) wrote :

When sparse images are uploaded with HTTP PUT to a vmware datastore, the parent directory may not exist and it will be automatically created. However, this is not the case when using datastore copy for fetching the image. In this case we should create the parent directory first.

The patch above fixes the problem.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/289269
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9f60d9bca77379b0429de7b66ba65bc37fd17448
Submitter: Jenkins
Branch: master

commit 9f60d9bca77379b0429de7b66ba65bc37fd17448
Author: Radoslav Gerganov <email address hidden>
Date: Mon Mar 7 13:06:38 2016 +0200

    VMware: create temp parent directory when booting sparse image

    When sparse images are uploaded with HTTP PUT to a vmware datastore,
    the parent directory may not exist and it will be automatically created.
    However, this is not the case when using datastore copy for fetching the
    image. In this case we should create the parent directory first.

    Change-Id: I18783e23ba487504e9130171c7424b807ad0251d
    Closes-Bug: #1552610

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/nova 14.0.0.0b1

This issue was fixed in the openstack/nova 14.0.0.0b1 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.