Package org.ovirt.engine.sdk4.services
Interface VmsService.AddRequest
-
- All Superinterfaces:
Request<VmsService.AddRequest,VmsService.AddResponse>
- Enclosing interface:
- VmsService
public static interface VmsService.AddRequest extends Request<VmsService.AddRequest,VmsService.AddResponse>
Creates a new virtual machine. The virtual machine can be created in different ways: - From a template. In this case the identifier or name of the template must be provided. For example, using a plain shell script and XML: [source,bash] ---- #!/bin/sh -ex url="https://engine.example.com/ovirt-engine/api" user="admin@internal" password="..." curl \ --verbose \ --cacert /etc/pki/ovirt-engine/ca.pem \ --user "${user}:${password}" \ --request POST \ --header "Version: 4" \ --header "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data 'myvm Blank mycluster myvm mycluster ... ---- When the virtual machine is created from a snapshot this set of disks is slightly different, it uses the `image_id` attribute instead of `id`. [source,xml] ----... ---- It is possible to specify additional virtual machine parameters in the XML description, e.g. a virtual machine of `desktop` type, with 2 GiB of RAM and additional description can be added sending a request body like the following: [source,xml] ----8d4bd566-6c86-4592-a4a7-912dbf93c298 myvm My Desktop Virtual Machine desktop 2147483648 ...... ---- In order to boot from CDROM, you first need to insert a disk, as described in the <>. Then booting from that CDROM can be specified using the `os.boot.devices` attribute: [source,xml] ---- ... ---- In all cases the name or identifier of the cluster where the virtual machine will be created is mandatory.cdrom
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VmsService.AddRequest
clone_(Boolean clone_)
Specifies if the virtual machine should be independent of the template.VmsService.AddRequest
clonePermissions(Boolean clonePermissions)
Specifies if the permissions of the template should be copied to the virtual machine.VmsService.AddRequest
filter(Boolean filter)
Relevant for admin users only.VmsService.AddRequest
vm(VmBuilder vm)
VmsService.AddRequest
vm(Vm vm)
-
-
-
Method Detail
-
clone_
VmsService.AddRequest clone_(Boolean clone_)
Specifies if the virtual machine should be independent of the template. When a virtual machine is created from a template by default the disks of the virtual machine depend on the disks of the template, they are using the https://en.wikipedia.org/wiki/Copy-on-write[_copy on write_] mechanism so that only the differences from the template take up real storage space. If this parameter is specified and the value is `true` then the disks of the created virtual machine will be _cloned_, and independent of the template. For example, to create an independent virtual machine, send a request like this: [source] ---- POST /ovirt-engine/vms?clone=true ---- With a request body like this: [source,xml] ----myvm mytemplate mycluster
-
clonePermissions
VmsService.AddRequest clonePermissions(Boolean clonePermissions)
Specifies if the permissions of the template should be copied to the virtual machine. If this optional parameter is provided, and its values is `true` then the permissions of the template (only the direct ones, not the inherited ones) will be copied to the created virtual machine. For example, to create a virtual machine from the `mytemplate` template copying its permissions, send a request like this: [source] ---- POST /ovirt-engine/api/vms?clone_permissions=true ---- With a request body like this: [source,xml] ----myvm mytemplate mycluster
-
filter
VmsService.AddRequest filter(Boolean filter)
Relevant for admin users only. Indicates whether to assign UserVmManager role on the created Virtual Machine for this user. This will enable the user to later access the Virtual Machine as though he were a non-admin user, foregoing his admin permissions (by providing filter=true). NOTE: admin-as-user (meaning providing filter=true) POST requests on an existing Virtual Machine will fail unless the Virtual Machine has been previously created by the admin as a user (meaning with filter=true).
-
vm
VmsService.AddRequest vm(Vm vm)
-
vm
VmsService.AddRequest vm(VmBuilder vm)
-
-