Hi,
There's an SDK example here [1], which starts a VM but defines its os as part of its parameter.
Maybe you can use it.
(There are also some other examples available here: https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples)

Regards,
Shani Leviim


On Sat, May 25, 2019 at 11:45 AM <weizhengya16@gmail.com> wrote:
I use following code to change it's os information
```
                vmService.update().
                    vm(
                        vm()
                        .os(
                             operatingSystem()
                             .type("other")
                           )
                    )
                    .send();
```
then I get an error like following:

   Exception in thread "main" org.ovirt.engine.sdk4.Error: Fault reason is "Operation Failed". Fault detail is "[Cannot edit VM. Invalid time zone for given OS type., Attribute: vmStatic]". HTTP response code is "400". HTTP response message is "Bad Request".

In my test, I find for the virtual machine which is in "down" status, it's running as same as I expect.But with those alive virtual machine with current os is not "other" ,it will make the mistake as above.
Could someone know what's the problem is and how to change the os type for alive virtual machine?
_______________________________________________
Devel mailing list -- devel@ovirt.org
To unsubscribe send an email to devel-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/devel@ovirt.org/message/EH64U5TJTAWGEEKNN3WLGDEPCX4VFMUZ/