Question

API update VM categorie. "Cannot clear previously set time zone"

  • 30 January 2019
  • 2 replies
  • 1515 views

Badge
Hi,

I want to set a VM to a categorie, using the REST API.
However I Get the message INVALID_REQUEST
code:
"Cannot clear previously set time zone


Don't know what to do with this.

Please note that I had to add the "power_state", because if I don't I get an INVALID_REQUEST
code:
 "VM power state must be specified for  Update operation."

Which I dont understand, as API documentation said power_state is optional.

Endpoint used: PUT /vms/{uuid}


Body:
code:
{
"spec": {
"name": "BACHELOR2018",
"resources": {
"power_state": "ON"
}
},
"api_version": "3.1",
"metadata": {
"kind": "vm",
"spec_version": 3,
"categories": {
"SLA": "A3"
}
}
}


Response body:
code:
{
"api_version": "3.1",
"code": 422,
"message_list": [
{
"message": "Cannot clear previously set time zone",
"reason": "INVALID_REQUEST"
}
],
"state": "ERROR"
}

This topic has been closed for comments

2 replies

Badge
OK i found,

I had to define the attribute
code:
"hardware_clock_timezone"


Don't know why it is needed, but still it works!
this code wiped all other settings for the VM (such as hard disk, vmnic etc). can i get similar without removing any other