Bug 886133 (domain_scan)

Summary: PRD32 - [RFE] Add the ability to scan/import existing disk images in a storage domain using REST-API
Product: Red Hat Enterprise Virtualization Manager Reporter: Chris Morrissey <cmorriss>
Component: RFEsAssignee: Ayal Baron <abaron>
Status: CLOSED ERRATA QA Contact: Jakub Libosvar <jlibosva>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: abaron, amureini, cpelland, dyasny, hateya, iheim, jdonohue, jfenal, jrankin, lpeer, scohen, sgrinber
Target Milestone: ---Keywords: FutureFeature, OtherQA
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Linux   
URL: http://wiki.ovirt.org/Features/Domain_Scan
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=1210498
Whiteboard: storage
Fixed In Version: sf11 Doc Type: Release Note
Doc Text:
The REST API can be used to check a storage domain for images that exist on it and are not saved to the Red Hat Enterprise Virtualization Manager's database. These disks images can be found by issuing the following GET request: http://<rhevm-engine>:8700/api/storagedomains/<storage domain id>/disks;unregistered These images can also be registered by issuing a POST request: http://<rhevm-engine>:8700/api/storagedomains/<storage domain id>/disks;unregistered <disk id="..."> <alias>myAlias</alias> </disk>
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-10 17:27:14 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 948448    

Description Chris Morrissey 2012-12-11 10:34:30 EST
Description of problem:
There is currently no way to import a disk that has been cloned outside of RHEV-M. We are working on a solution to provide access to utilize NetApp's rapid cloning capabilities and require the ability to import disks into REHV-M that we clone externally.

Version-Release number of selected component (if applicable):
3.2

How reproducible:
This can be manually reproduced by copying an existing disk image into a new directory on the storage domain with a new UUID for the image and volumes contained inside. The metadata for the volume would then need to be updated to include the new UUID of the image containing it.

Steps to Reproduce:
1. Mount an existing NFS storage domain on a linux system and create a new directory under the images directory with a newly generated UUID for the name. You can generate a new UUID using the command "uuidgen".
2. Copy another volume including the meta data file to that new image directory.
3. Generate another new UUID and rename the volume file and meta file to the new UUID.
4. Open the <UUID>.meta file and update the UUID value for the IMAGE to be the new image UUID.
5. Log into RHEV-M and notice that the disk does not show up in the available disks.  

Actual results:
The new disk does not show up.

Expected results:
After running the new REST API, the disk will be available for use in RHEV-M.

Testing steps:
1. Perform steps 1 - 4 in the reproduction steps.
2. Execute the REST API with the URL: http://hostname:port/api/disks/scan/<storage domain UUID>
3. The storage domain will be scanned for new disks and they will be added to RHEV-M.
4. Log into the RHEV-M admin UI and verify the disks are now available for use.
Comment 2 Ayal Baron 2012-12-19 03:31:04 EST
(In reply to comment #0)
> Description of problem:
> There is currently no way to import a disk that has been cloned outside of
> RHEV-M. We are working on a solution to provide access to utilize NetApp's
> rapid cloning capabilities and require the ability to import disks into
> REHV-M that we clone externally.
> 
> Version-Release number of selected component (if applicable):
> 3.2
> 
> How reproducible:
> This can be manually reproduced by copying an existing disk image into a new
> directory on the storage domain with a new UUID for the image and volumes
> contained inside. The metadata for the volume would then need to be updated
> to include the new UUID of the image containing it.
> 
> Steps to Reproduce:
> 1. Mount an existing NFS storage domain on a linux system and create a new
> directory under the images directory with a newly generated UUID for the
> name. You can generate a new UUID using the command "uuidgen".
> 2. Copy another volume including the meta data file to that new image
> directory.
> 3. Generate another new UUID and rename the volume file and meta file to the
> new UUID.
> 4. Open the <UUID>.meta file and update the UUID value for the IMAGE to be
> the new image UUID.
> 5. Log into RHEV-M and notice that the disk does not show up in the
> available disks.  
> 
> Actual results:
> The new disk does not show up.
> 
> Expected results:
> After running the new REST API, the disk will be available for use in RHEV-M.
> 
> Testing steps:
> 1. Perform steps 1 - 4 in the reproduction steps.
> 2. Execute the REST API with the URL:
> http://hostname:port/api/disks/scan/<storage domain UUID>
> 3. The storage domain will be scanned for new disks and they will be added
> to RHEV-M.

One small point about this, I would prefer the import of the disks into the system to be manual (i.e. scan should return a list and then you would need to specifically choose which disks you want to import as 'floating')

> 4. Log into the RHEV-M admin UI and verify the disks are now available for
> use.
Comment 5 Chris Morrissey 2013-01-10 12:52:31 EST
The NetApp QA team will be testing this functionality in the context of NetApp controllers. This will include various positive and negative test scenarios.
Comment 8 James Rankin 2013-02-07 14:58:42 EST
Chris, has the last patch needed for this been pushed yet? Thanks
Comment 9 Chris Morrissey 2013-02-07 15:32:12 EST
James, The latest patch has been pushed for this. I'm working on updates based on initial reviews. Looks like minor change so far which is good.

Ayal, The latest patch has changed to split the scanning and registering into two separate API calls as you suggest. One call lists the available unregistered disks and the other will register a single disk at a time.

Here's a link to the associated patch: http://gerrit.ovirt.org/#/c/11783/
Comment 10 Ayal Baron 2013-02-08 01:39:43 EST
(In reply to comment #9)
> James, The latest patch has been pushed for this. I'm working on updates
> based on initial reviews. Looks like minor change so far which is good.
> 
> Ayal, The latest patch has changed to split the scanning and registering
> into two separate API calls as you suggest. One call lists the available
> unregistered disks and the other will register a single disk at a time.
> 
> Here's a link to the associated patch: http://gerrit.ovirt.org/#/c/11783/
Comment 13 Jakub Libosvar 2013-04-22 06:26:30 EDT
Verified in rhevm-3.2.0-10.19.beta2.el6ev.noarch
Comment 14 errata-xmlrpc 2013-06-10 17:27:14 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0888.html