Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Description of problem: Allow change of some Volume attributes on any host using Job infrastructure. Version-Release number of selected component (if applicable): oVirt 4.1 Add API for SDM.update_volume verb that allows to change volume metadata from any host. The supported metadata that can be changed: - description of the volume - volume type (allow making a leaf volume shared) - legality (legal/illegal) - generation
The new verb is required for implementing virt-sysprep, see bug 1335642. In this flow, engine creates a template as regular volume (type=LEAF). Then we run sysprep on the volume, and finally we convert the volume to shared (type=SHARED) using the new verb.
How to test this verb: 1. Create json file with the request parameters: $ cat update.json { "job_id":"d4813705-6812-4886-9fdb-dc539ee21aa8", "vol_info": { "sd_id": "9a12f95d-2073-4a70-b592-1fb50ffc8eee", "img_id": "a82edcb3-257e-4ff2-bf75-cde432a05dde", "vol_id": "ef08e9ea-8125-44c1-9736-916addb60ade", "generation": 0 }, "vol_attr": { "description": "my fancy description", "generation": 57, "legality": "ILLEGAL" } } 2. Use vdsm-client to send a request: $ vdsm-client SDM update_volume -f update.json 3. Check job status: $ vdsm-client Host getJobs 4. Check volume info $ vdsm-client Volume getInfo \ storagepoolID=sp_id \ storagedomainID=sd_id \ imageID=img_id \ volumeID=vol_id The volume description, generation and legality should change.
Target release should be placed once a package build is known to fix a issue. Since this bug is not modified, the target version has been reset. Please use target milestone to plan a fix for a oVirt release.
generation, description and legality are now editable via 'update_volume', tested as suggested in comment #3: [root@storage-ge2-vdsm1 ~]# cat update.json { "job_id":"ce3dfc48-7204-4819-8734-05666618d41e", "vol_info": { "sd_id": "b773dcff-b468-4fd4-9bf5-9f83b4f4a809", "img_id": "05a7e594-7dd5-4898-817a-9dc9c9e7dd6b", "vol_id": "24102480-18d2-4589-8460-04627191cdbe", "generation": 0 }, "vol_attr": { "description": "my fancy description", "generation": 57, "legality": "ILLEGAL" } } [root@storage-ge2-vdsm1 ~]# vdsm-client SDM update_volume -f update.json true [root@storage-ge2-vdsm1 ~]# vdsm-client Host getJobs { "ce3dfc48-7204-4819-8734-05666618d41e": { "status": "done", "job_type": "storage", "id": "ce3dfc48-7204-4819-8734-05666618d41e", "description": "update_volume" } } [root@storage-ge2-vdsm1 ~]# vdsm-client Volume getInfo \ > storagepoolID=fc52e0e4-5246-4f14-8269-a256c62608f9 \ > storagedomainID=b773dcff-b468-4fd4-9bf5-9f83b4f4a809 \ > imageID=05a7e594-7dd5-4898-817a-9dc9c9e7dd6b \ > volumeID=24102480-18d2-4589-8460-04627191cdbe { "status": "ILLEGAL", "lease": { "owners": [], "version": null }, "domain": "b773dcff-b468-4fd4-9bf5-9f83b4f4a809", "capacity": "1073741824", "voltype": "LEAF", "description": "my fancy description", "parent": "00000000-0000-0000-0000-000000000000", "format": "RAW", "generation": 57, "image": "05a7e594-7dd5-4898-817a-9dc9c9e7dd6b", "uuid": "24102480-18d2-4589-8460-04627191cdbe", "disktype": "2", "legality": "ILLEGAL", "mtime": "0", "apparentsize": "1073741824", "truesize": "0", "type": "SPARSE", "children": [], "pool": "", "ctime": "1485343754" } ========================================================== Used: vdsm-4.19.2-2.el7ev.x86_64 vdsm-cli-4.19.2-2.el7ev.noarch vdsm-jsonrpc-4.19.2-2.el7ev.noarch vdsm-client-4.19.2-2.el7ev.noarch vdsm-xmlrpc-4.19.2-2.el7ev.noarch vdsm-yajsonrpc-4.19.2-2.el7ev.noarch vdsm-python-4.19.2-2.el7ev.noarch vdsm-api-4.19.2-2.el7ev.noarch