Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 885452 - [Storage] Can not export VM with shared disk using collapse snapshot option.
[Storage] Can not export VM with shared disk using collapse snapshot option.
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
unspecified
Unspecified Unspecified
high Severity high
: ---
: 3.2.0
Assigned To: Tal Nisan
Leonid Natapov
storage
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-12-09 10:11 EST by Leonid Natapov
Modified: 2016-02-10 12:28 EST (History)
10 users (show)

See Also:
Fixed In Version: SF9
Doc Type: Release Note
Doc Text:
Previously, virtual machine which contained shareable disks could not be exported because the export command did not recognise shared disks. The export command now accounts for shared disks, so virtual machines with shared disks are exported successfully.
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 10977 None None None Never

  None (edit)
Description Leonid Natapov 2012-12-09 10:11:05 EST
[Storage] Can not export VM with shared disk using collapse snapshot option.
VM that has shared disk can not be exported if "collapse snapshot" option is used. It happens because we are not exporting shared disk (which is correct) but in the flow when collapse snapshot involved we don't filter shared disk and send its ID in getImageInfo which is wrong.  Therefore the export fails.

Here is the problematic code:
------------------------------------------------------------------------------
public boolean updateCopyVmInSpm(Guid storagePoolId, VM vm, Guid storageDomainId) {
         HashMap<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndMetaDictionary =
         new HashMap<Guid, KeyValuePairCompat<String, List<Guid>>>();
         OvfManager ovfManager = new OvfManager();
         ArrayList<DiskImage> AllVmImages = new ArrayList<DiskImage>();
         VmHandler.updateDisksFromDb(vm);
         List<VmNetworkInterface> interfaces = vm.getInterfaces();
         if (interfaces != null) {

             // TODO remove this when the API changes

             interfaces.clear();
             interfaces.addAll(DbFacade.getInstance().getVmNetworkInterfaceDao().getAllForVm(vm.getId()));
         }
         for (Disk disk : vm.getDiskMap().values()) {
             if (DiskStorageType.IMAGE == disk.getDiskStorageType()) {
                 DiskImage diskImage = (DiskImage) disk;
                 diskImage.setParentId(VmTemplateHandler.BlankVmTemplateId);
                 diskImage.setit_guid(VmTemplateHandler.BlankVmTemplateId);
                 diskImage.setstorage_ids(new ArrayList<Guid>(Arrays.asList(storageDomainId)));
                 DiskImage diskForVolumeInfo = getDiskForVolumeInfo(diskImage);
                 diskImage.setvolume_format(diskForVolumeInfo.getvolume_format());
                 diskImage.setvolume_type(diskForVolumeInfo.getvolume_type());
                 VDSReturnValue vdsReturnValue = Backend
                             .getInstance()
                             .getResourceManager()
                             .RunVdsCommand(
                                     VDSCommandType.GetImageInfo,
                                    new GetImageInfoVDSCommandParameters(storagePoolId, storageDomainId, diskImage
                                             .getId(), diskImage.getImageId()));
                 if (vdsReturnValue != null && vdsReturnValue.getSucceeded()) {
                     DiskImage fromVdsm = (DiskImage) vdsReturnValue.getReturnValue();
                     diskImage.setactual_size(fromVdsm.get

--------------------------------------------------------------------------------
How to reproduce:

1.Create VM with 2 or more disks when one of the disks is shared disk.
2.Create export domain.
3.Try to export VM to export domain (check option collpase snapshot).

You will get the following error in the engine.log
---------------------------------------------------
2012-12-09 14:50:54,535 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (pool-3-thread-41) START, GetImageInfoVDSCommand( storagePoolId = c4584f01-cbbb-4e9e-8672-3deb841127a3, ignoreFailoverLimit = false, compata
bilityVersion = null, storageDomainId = 72ec1321-a114-451f-bee1-6790cbca1bc6, imageGroupId = 89ec86a6-ef6b-4337-8fb3-b17f988228fd, imageId = 31318ef0-b9c4-47a4-88fb-b5ab021cea68), log id: 77768cf8
2012-12-09 14:50:54,572 ERROR [org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand] (pool-3-thread-41) IrsBroker::getImageInfo::Failed getting image info imageId = 31318ef0-b9c4-47a4-88fb-b5ab021cea68 does not exist on domai
nName = New_Export , domainId = 72ec1321-a114-451f-bee1-6790cbca1bc6,  error code: ImagePathError, message: Image path does not exist or cannot be accessed/created: ('/rhev/data-center/c4584f01-cbbb-4e9e-8672-3deb841127a3/72ec1321-a114-4
51f-bee1-6790cbca1bc6/images/89ec86a6-ef6b-4337-8fb3-b17f988228fd',)
2012-12-09 14:50:54,573 INFO  [org.ovirt.engine.core.vdsbroker.vdsbroker.BrokerCommandBase] (pool-3-thread-41) Command org.ovirt.engine.core.vdsbroker.irsbroker.GetImageInfoVDSCommand return value 
 
Class Name: org.ovirt.engine.core.vdsbroker.irsbroker.OneImageInfoReturnForXmlRpc
mInfo                         Null
mStatus                       Class Name: org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc
mCode                         254
mMessage                      Image path does not exist or cannot be accessed/created: ('/rhev/data-center/c4584f01-cbbb-4e9e-8672-3deb841127a3/72ec1321-a114-451f-bee1-6790cbca1bc6/images/89ec86a6-ef6b-4337-8fb3-b17f988228fd',)
----------------------------------------------------------------------------
Reproduces:
100%.
Comment 1 Tal Nisan 2013-01-14 07:53:57 EST
http://gerrit.ovirt.org/#/c/10977/
Comment 2 Leonid Natapov 2013-03-04 11:35:14 EST
sf9. fixed.
Comment 4 Itamar Heim 2013-06-11 04:23:32 EDT
3.2 has been released
Comment 5 Itamar Heim 2013-06-11 04:25:25 EDT
3.2 has been released

Note You need to log in before you can comment on or make changes to this bug.