Class VmsServiceImpl

    • Method Detail

      • add

        public VmsService.AddRequest add()
        Description copied from interface: VmsService
        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 mycluster ' \ "${url}/vms" ---- - From a snapshot. In this case the identifier of the snapshot has to be provided. For example, using a plain shel 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 "Content-Type: application/xml" \ --header "Accept: application/xml" \ --data ' myvm mycluster ' \ "${url}/vms" ---- When creating a virtual machine from a template or from a snapshot it is usually useful to explicitly indicate in what storage domain to create the disks for the virtual machine. If the virtual machine is created from a template then this is achieved passing a set of `disk_attachment` elements that indicate the mapping: [source,xml] ---- ... ---- 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] ---- ... 8d4bd566-6c86-4592-a4a7-912dbf93c298 ---- 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] ---- myvm My Desktop Virtual Machine desktop 2147483648 ... ---- A bootable CDROM device can be set like this: [source,xml] ---- ... ---- 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] ---- ... cdrom ---- In all cases the name or identifier of the cluster where the virtual machine will be created is mandatory.
        Specified by:
        add in interface VmsService
      • list

        public VmsService.ListRequest list()
        Description copied from interface: VmsService
        Returns the list of virtual machines of the system. The order of the returned list of virtual machines is guaranteed only if the `sortby` clause is included in the `search` parameter.
        Specified by:
        list in interface VmsService
      • service

        public Service service​(String path)
        Description copied from interface: VmsService
        Service locator method, returns individual service on which the URI is dispatched.
        Specified by:
        service in interface VmsService