Interface TemplatesService.AddRequest

  • All Superinterfaces:
    Request<TemplatesService.AddRequest,​TemplatesService.AddResponse>
    Enclosing interface:
    TemplatesService

    public static interface TemplatesService.AddRequest
    extends Request<TemplatesService.AddRequest,​TemplatesService.AddResponse>
    Creates a new template. This requires the `name` and `vm` elements. To identify the virtual machine use the `vm.id` or `vm.name` attributes. For example, to create a template from a virtual machine with the identifier `123` send a request like this: [source] ---- POST /ovirt-engine/api/templates ---- With a request body like this: [source,xml] ---- ---- Since version 4.3, in order to create virtual machine template from a snapshot send a request body like this: [source,xml] ---- ---- The disks of the template can be customized, making some of their characteristics different from the disks of the original virtual machine. To do so use the `vm.disk_attachments` attribute, specifying the identifier of the disk of the original virtual machine and the characteristics that you want to change. For example, if the original virtual machine has a disk with the identifier `456`, and, for that disk, you want to change the name to `mydisk` the format to <> and make it <>, send a request body like this: [source,xml] ---- ---- The template can be created as a sub-version of an existing template. This requires the `name` and `vm` attributes for the new template, and the `base_template` and `version_name` attributes for the new template version. The `base_template` and `version_name` attributes must be specified within a `version` section enclosed in the `template` section. Identify the virtual machine with the `id` or `name` attributes. [source,xml] ---- ---- The destination storage domain of the template can be customized, in one of two ways: 1. Globally, at the request level. The request must list the desired disk attachments to be created on the storage domain. If the disk attachments are not listed, the global storage domain parameter will be ignored. + [source,xml] ---- ---- 2. Per each disk attachment. Specify the desired storage domain for each disk attachment. Specifying the global storage definition will override the storage domain per disk attachment specification. + [source,xml] ---- ----
    • Method Detail

      • clonePermissions

        TemplatesService.AddRequest clonePermissions​(Boolean clonePermissions)
        Specifies if the permissions of the virtual machine should be copied to the template. If this optional parameter is provided, and its value is `true`, then the permissions of the virtual machine (only the direct ones, not the inherited ones) will be copied to the created template. For example, to create a template from the `myvm` virtual machine copying its permissions, send a request like this: [source] ---- POST /ovirt-engine/api/templates?clone_permissions=true ---- With a request body like this: [source,xml] ---- ----
      • seal

        TemplatesService.AddRequest seal​(Boolean seal)
        Seals the template. If this optional parameter is provided and its value is `true`, then the template is sealed after creation. Sealing erases all host-specific configuration from the filesystem: SSH keys, UDEV rules, MAC addresses, system ID, hostname, and so on, thus making it easier to use the template to create multiple virtual machines without manual intervention. Currently, sealing is supported only for Linux operating systems.