fog-openstack
fog-openstack copied to clipboard
The volume updating method error of cinder
My test code: def test_cinder_backups_all [email protected]("c2538dd7-de9e-4dfc-ae91-aff6dcb051b2") getvolume.name="zhoutk" getvolume.update end
When I run this code,there is an error,I found the update method request body includes all the atrributes got from the getting volume method,so resulted the error.
The official api definition only supports six parameters as follow: http://developer.openstack.org/api-ref/block-storage/v2/?expanded=update-volume-detail
the update request body as follow: {"volume":{"id":"c2538dd7-de9e-4dfc-ae91-aff6dcb051b2","links":[{"href":"https://volume.region.eu-de.otc-tsi.de/v2/a005c8d039ee4980a919cfc6cffd020a/volumes/c2538dd7-de9e-4dfc-ae91-aff6dcb051b2","rel":"self"},{"href":"https://volume.region.eu-de.otc-tsi.de/a005c8d039ee4980a919cfc6cffd020a/volumes/c2538dd7-de9e-4dfc-ae91-aff6dcb051b2","rel":"bookmark"}],"name":"zhoutk","status":"in-use","attachments":[{"server_id":"4a69aca2-e9ed-4f03-91d7-44233f7577b2","attachment_id":"f466fc8b-5fdb-43b3-b2f6-f78c31f81759","attached_at":"2016-12-26T08:34:55.329985","host_name":null,"volume_id":"c2538dd7-de9e-4dfc-ae91-aff6dcb051b2","device":"/dev/sda","id":"c2538dd7-de9e-4dfc-ae91-aff6dcb051b2"}],"description":null,"size":40,"metadata":{"attached_mode":"rw","billing":"1","resourceType":"cloud.resource.type.volume","resourceSpecCode":"SATA","quantityGB":"40","imageID":"cdb6eecf-8246-497d-bfd6-a35eb1904897","StorageType":"FC_DSWARE","policy":"dad76e17-3280-4d0b-8f3d-91793d1e81f9","os_type":"Linux","sys_is_server_vol":"true","readonly":"False"},"encrypted":false,"bootable":"true","shareable":"false","availability_zone":"eu-de-01","os-vol-host-attr:host":"pod01.eu-de-01#SATA","source_volid":null,"snapshot_id":null,"created_at":"2016-12-26T08:33:14.292124","volume_type":"SATA","tenant_id":"a005c8d039ee4980a919cfc6cffd020a","volume_image_metadata":{"__originalimagename":"cdb6eecf-8246-497d-bfd6-a35eb1904897","__is_config_init":"false","container_format":"bare","min_ram":"0","__account_code":"","image_name":"ubuntu1604","__os_bit":"64","__is_support_kvm":"false","__os_type":"Linux","__productcode":"","min_disk":"40","__data_origin":"file,zhoutk:ubuntu-16.04-server-cloudimg-amd64-disk1.img","virtual_env_type":"FusionCompute","size":"2","__os_version":"Ubuntu 16.04 server 64bit","__backup_id":"","__description":"","__is_support_hana":"false","image_id":"cdb6eecf-8246-497d-bfd6-a35eb1904897","__support_gpu_type":"false","__imagetype":"private","disk_format":"vhd","__image_source_type":"uds","checksum":"99914b932bd37a50b983c5e7c90ae93b","__isregistered":"true","__image_size":"291450880","__platform":"Ubuntu","__root_origin":"file"},"os-vol-mig-status-attr:migstat":null,"os-vol-mig-status-attr:name_id":null,"replication_status":"disabled","user_id":"33b78753d0f8426591f78e8b04990516","consistencygroup_id":null,"updated_at":"2016-12-26T08:34:55.382283","os-volume-replication:extended_status":null,"os-volume-replication:driver_data":null}}
Can you let me know what happens if you run the code like this?
def test_cinder_backups_all
getvolume = @volumeService.volumes.get("c2538dd7-de9e-4dfc-ae91-aff6dcb051b2")
getvolume.name = "zhoutk"
getvolume.save
end