Bug 1409380 - storage: update volume attributes on any host
Summary: storage: update volume attributes on any host
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: vdsm
Classification: oVirt
Component: General
Version: 4.19.11
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ovirt-4.1.0-beta
: 4.19.2
Assignee: Fred Rolland
QA Contact: Elad
URL:
Whiteboard:
Depends On:
Blocks: RHV_virt_sysprep
TreeView+ depends on / blocked
 
Reported: 2017-01-01 13:19 UTC by Fred Rolland
Modified: 2017-02-01 14:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-01 14:47:45 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 69374 0 'None' MERGED storage: rename volume attributes class 2021-02-11 13:35:44 UTC
oVirt gerrit 69376 0 'None' MERGED storage: Add API for SDM update_volume 2021-02-11 13:35:44 UTC

Description Fred Rolland 2017-01-01 13:19:14 UTC
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:

Comment 1 Fred Rolland 2017-01-01 13:22:36 UTC
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

Comment 2 Nir Soffer 2017-01-01 14:06:32 UTC
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.

Comment 3 Nir Soffer 2017-01-02 22:32:34 UTC
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.

Comment 4 Red Hat Bugzilla Rules Engine 2017-01-03 09:30:26 UTC
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.

Comment 5 Elad 2017-01-25 11:40:54 UTC
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


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