Bug 1564898
| Summary: | REST API does not update disk's read_only status | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Derrick Ornelas <dornelas> |
| Component: | ovirt-engine | Assignee: | shani <sleviim> |
| Status: | CLOSED ERRATA | QA Contact: | Radim Hrazdil <rhrazdil> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 4.1.10 | CC: | apinnick, dornelas, ebenahar, kshukla, lsurette, lsvaty, rbalakri, Rhev-m-bugs, sleviim, srevivo, tnisan, ykaul, ylavi |
| Target Milestone: | ovirt-4.2.3 | Flags: | ykaul:
needinfo+
amureini: needinfo+ |
| Target Release: | 4.2.0 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2018-05-15 17:48:41 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Derrick Ornelas
2018-04-08 18:10:02 UTC
I've also tested this with the v3 API, and, although /api/v3/vms/<vm_guid>/disks/<disk_id> does not return the read_only value at all, it does get updated properly # cat testv3.sh #!/bin/bash -x curl -v -u "admin@internal:mypass" "https://rhvm.example.com/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4" echo -e "\n###\n" curl -vvv -u "admin@internal:mypass" -X PUT -H "Content-Type: application/xml" -d "<disk><read_only>false</read_only></disk>" "https://rhvm.example.com/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4" echo -e "\n###\n" curl -v -u "admin@internal:mypass" "https://rhvm.example.com/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4" # /usr/share/ovirt-engine/dbscripts/engine-psql.sh -c "select is_readonly from vm_device where device_id = '6ce0cc76-7be2-42c8-876b-769a5223e3e4'" is_readonly ------------- t (1 row) # ./testv3.sh + curl -v -u 'admin@internal:mypass' https://rhvm.example.com/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4 * About to connect() to rhvm.example.com port 443 (#0) * Trying 10.10.10.10... * Connected to rhvm.example.com (10.10.10.10) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 * Server certificate: * subject: CN=rhvm.example.com,O=example.com,C=US * start date: Mar 28 07:35:11 2018 GMT * expire date: Mar 03 07:35:12 2023 GMT * common name: rhvm.example.com * issuer: CN=rhvm.example.com.84661,O=example.com,C=US * Server auth using Basic with user 'admin@internal' > GET /ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4 HTTP/1.1 > Authorization: Basic YWRtaW5AaW50ZXJuYWw6UmVkSGF0MSE= > User-Agent: curl/7.29.0 > Host: rhvm.example.com > Accept: */* > < HTTP/1.1 200 OK < Date: Sun, 08 Apr 2018 17:37:54 GMT < Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips < Content-Type: application/xml;charset=UTF-8 < Content-Length: 2198 < Correlation-Id: 35017d39-fcc8-49bf-ad7d-6a3374c881a4 < Vary: Accept-Encoding < <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <disk href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4" id="6ce0cc76-7be2-42c8-876b-769a5223e3e4"> <actions> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/activate" rel="activate"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/deactivate" rel="deactivate"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/export" rel="export"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/move" rel="move"/> </actions> <name>myLUN</name> <description>9de6</description> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/permissions" rel="permissions"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/statistics" rel="statistics"/> <vm href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff" id="288662ee-e893-4e0a-be56-4a01af5c00ff"/> <alias>myLUN</alias> <interface>virtio_scsi</interface> <bootable>false</bootable> <shareable>false</shareable> <wipe_after_delete>false</wipe_after_delete> <propagate_errors>false</propagate_errors> <active>true</active> <lun_storage id="36001405cb64e284724a4b88a82559de6"> <logical_unit id="36001405cb64e284724a4b88a82559de6"> <serial>SLIO-ORG_iscsilun07_cb64e284-724a-4b88-a825-59de6c878fa0</serial> <vendor_id>LIO-ORG</vendor_id> <product_id>iscsilun07</product_id> <lun_mapping>10</lun_mapping> <size>1073741824</size> <paths>0</paths> <disk_id>6ce0cc76-7be2-42c8-876b-769a5223e3e4</disk_id> </logical_unit> </lun_storage> <uses_scsi_reservation>false</uses_scsi_reservation> <storage_type>lun</storage_type> </disk> * Connection #0 to host rhvm.example.com left intact + echo -e '\n###\n' ### + curl -vvv -u 'admin@internal:mypass' -X PUT -H 'Content-Type: application/xml' -d '<disk><read_only>false</read_only></disk>' https://rhvm.example.com/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4 * About to connect() to rhvm.example.com port 443 (#0) * Trying 10.10.10.10... * Connected to rhvm.example.com (10.10.10.10) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 * Server certificate: * subject: CN=rhvm.example.com,O=example.com,C=US * start date: Mar 28 07:35:11 2018 GMT * expire date: Mar 03 07:35:12 2023 GMT * common name: rhvm.example.com * issuer: CN=rhvm.example.com.84661,O=example.com,C=US * Server auth using Basic with user 'admin@internal' > PUT /ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4 HTTP/1.1 > Authorization: Basic YWRtaW5AaW50ZXJuYWw6UmVkSGF0MSE= > User-Agent: curl/7.29.0 > Host: rhvm.example.com > Accept: */* > Content-Type: application/xml > Content-Length: 41 > * upload completely sent off: 41 out of 41 bytes < HTTP/1.1 200 OK < Date: Sun, 08 Apr 2018 17:37:55 GMT < Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips < Content-Type: application/xml;charset=UTF-8 < Content-Length: 2198 < Correlation-Id: ecf1f0ba-570e-498c-a90e-de2e282928b8 < Vary: Accept-Encoding < <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <disk href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4" id="6ce0cc76-7be2-42c8-876b-769a5223e3e4"> <actions> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/activate" rel="activate"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/deactivate" rel="deactivate"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/export" rel="export"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/move" rel="move"/> </actions> <name>myLUN</name> <description>9de6</description> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/permissions" rel="permissions"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/statistics" rel="statistics"/> <vm href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff" id="288662ee-e893-4e0a-be56-4a01af5c00ff"/> <alias>myLUN</alias> <interface>virtio_scsi</interface> <bootable>false</bootable> <shareable>false</shareable> <wipe_after_delete>false</wipe_after_delete> <propagate_errors>false</propagate_errors> <active>true</active> <lun_storage id="36001405cb64e284724a4b88a82559de6"> <logical_unit id="36001405cb64e284724a4b88a82559de6"> <serial>SLIO-ORG_iscsilun07_cb64e284-724a-4b88-a825-59de6c878fa0</serial> <vendor_id>LIO-ORG</vendor_id> <product_id>iscsilun07</product_id> <lun_mapping>10</lun_mapping> <size>1073741824</size> <paths>0</paths> <disk_id>6ce0cc76-7be2-42c8-876b-769a5223e3e4</disk_id> </logical_unit> </lun_storage> <uses_scsi_reservation>false</uses_scsi_reservation> <storage_type>lun</storage_type> </disk> * Connection #0 to host rhvm.example.com left intact + echo -e '\n###\n' ### + curl -v -u 'admin@internal:mypass' https://rhvm.example.com/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4 * About to connect() to rhvm.example.com port 443 (#0) * Trying 10.10.10.10... * Connected to rhvm.example.com (10.10.10.10) port 443 (#0) * Initializing NSS with certpath: sql:/etc/pki/nssdb * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 * Server certificate: * subject: CN=rhvm.example.com,O=example.com,C=US * start date: Mar 28 07:35:11 2018 GMT * expire date: Mar 03 07:35:12 2023 GMT * common name: rhvm.example.com * issuer: CN=rhvm.example.com.84661,O=example.com,C=US * Server auth using Basic with user 'admin@internal' > GET /ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4 HTTP/1.1 > Authorization: Basic YWRtaW5AaW50ZXJuYWw6UmVkSGF0MSE= > User-Agent: curl/7.29.0 > Host: rhvm.example.com > Accept: */* > < HTTP/1.1 200 OK < Date: Sun, 08 Apr 2018 17:37:55 GMT < Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips < Content-Type: application/xml;charset=UTF-8 < Content-Length: 2198 < Correlation-Id: 0942891f-eb01-4d3b-afa1-089e93cf9aa8 < Vary: Accept-Encoding < <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <disk href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4" id="6ce0cc76-7be2-42c8-876b-769a5223e3e4"> <actions> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/activate" rel="activate"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/deactivate" rel="deactivate"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/export" rel="export"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/move" rel="move"/> </actions> <name>myLUN</name> <description>9de6</description> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/permissions" rel="permissions"/> <link href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff/disks/6ce0cc76-7be2-42c8-876b-769a5223e3e4/statistics" rel="statistics"/> <vm href="/ovirt-engine/api/v3/vms/288662ee-e893-4e0a-be56-4a01af5c00ff" id="288662ee-e893-4e0a-be56-4a01af5c00ff"/> <alias>myLUN</alias> <interface>virtio_scsi</interface> <bootable>false</bootable> <shareable>false</shareable> <wipe_after_delete>false</wipe_after_delete> <propagate_errors>false</propagate_errors> <active>true</active> <lun_storage id="36001405cb64e284724a4b88a82559de6"> <logical_unit id="36001405cb64e284724a4b88a82559de6"> <serial>SLIO-ORG_iscsilun07_cb64e284-724a-4b88-a825-59de6c878fa0</serial> <vendor_id>LIO-ORG</vendor_id> <product_id>iscsilun07</product_id> <lun_mapping>10</lun_mapping> <size>1073741824</size> <paths>0</paths> <disk_id>6ce0cc76-7be2-42c8-876b-769a5223e3e4</disk_id> </logical_unit> </lun_storage> <uses_scsi_reservation>false</uses_scsi_reservation> <storage_type>lun</storage_type> </disk> * Connection #0 to host rhvm.example.com left intact # /usr/share/ovirt-engine/dbscripts/engine-psql.sh -c "select is_readonly from vm_device where device_id = '6ce0cc76-7be2-42c8-876b-769a5223e3e4'" is_readonly ------------- f (1 row) Verified using suggested reproduction flow in the description that readonly value is properly updated from true to false as well as from false to true. Version 4.2.3.2-0.1.el7 python-ovirt-engine-sdk4-4.2.6-1.el7ev.x86_64 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. https://access.redhat.com/errata/RHEA-2018:1488 BZ<2>Jira Resync |