vcenter vm template library items: create spec

The create_spec structure defines the information required to create a library item containing a virtual machine template. This structure was added in vSphere API 6.8.

Representation:

{
    "library""obj-103",
    "disk_storage"{
        "datastore""obj-103",
        "storage_policy"{
            "type""USE_SPECIFIED_POLICY",
            "policy""obj-103"
        }
    },
    "name""string",
    "description""string",
    "vm_home_storage"{
        "datastore""obj-103",
        "storage_policy"{
            "type""USE_SPECIFIED_POLICY",
            "policy""obj-103"
        }
    },
    "disk_storage_overrides"{
        "obj-103"{
            "datastore""obj-103",
            "storage_policy"{
                "type""USE_SPECIFIED_POLICY",
                "policy""obj-103"
            }
        }
    },
    "placement"{
        "cluster""obj-103",
        "folder""obj-103",
        "host""obj-103",
        "resource_pool""obj-103"
    },
    "source_vm""obj-103"
}
{
    "library""obj-103",
    "disk_storage"{
        "datastore""obj-103",
        "storage_policy"{
            "type""USE_SPECIFIED_POLICY",
            "policy""obj-103"
        }
    },
    "name""string",
    "description""string",
    "vm_home_storage"{
        "datastore""obj-103",
        "storage_policy"{
            "type""USE_SPECIFIED_POLICY",
            "policy""obj-103"
        }
    },
    "disk_storage_overrides"[
        {
            "value"{
                "datastore""obj-103",
                "storage_policy"{
                    "type""USE_SPECIFIED_POLICY",
                    "policy""obj-103"
                }
            },
            "key""obj-103"
        }
    ],
    "placement"{
        "cluster""obj-103",
        "folder""obj-103",
        "host""obj-103",
        "resource_pool""obj-103"
    },
    "source_vm""obj-103"
}

Attributes:

Name Type Description
Required
-.source_vm string Identifier of the source virtual machine to create the library item from. This attribute was added in vSphere API 6.8.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: VirtualMachine. When operations return a value of this structure as a result, the field will be an identifier for the resource type: VirtualMachine.

-.name string Name of the library item. This attribute was added in vSphere API 6.8.

-.library string Identifier of the library in which the new library item should be created. This attribute was added in vSphere API 6.8.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.content.Library. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.content.Library.

-.vm_home_storage.storage_policy.type string Policy type to be used when creating the virtual machine template's configuration and log files. This attribute was added in vSphere API 6.8.

Policy type for the virtual machine template's configuration and log files. This enumeration was added in vSphere API 6.8. Value is one of:
USE_SPECIFIED_POLICY: Use the specified policy. This constant was added in vSphere API 6.8.

-.disk_storage.storage_policy.type string Policy type to be used when creating a virtual machine template's disk. This attribute was added in vSphere API 6.8.

Policy type for a virtual machine template's disk. This enumeration was added in vSphere API 6.8. Value is one of:
USE_SPECIFIED_POLICY: Use the specified policy. This constant was added in vSphere API 6.8.

Optional
-.description string Description of the library item. This attribute was added in vSphere API 6.8.

Optional. If unset, the newly created library item has the same description as the source virtual machine.

-.vm_home_storage create_spec_vm_home_storage Storage location for the virtual machine template's configuration and log files. This attribute was added in vSphere API 6.8.

Optional. If unset, the virtual machine template's configuration and log files are placed on the default storage backing associated with the library specified by library.

-.vm_home_storage.datastore string Identifier of the datastore for the virtual machine template's configuration and log files. This attribute was added in vSphere API 6.8.

Optional. This field is currently required.

When storage_policy is also specified and is incompatible with the datastore, then the virtual machine template will be flagged as being out of compliance with the specified storage policy.

. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Datastore. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Datastore.
-.vm_home_storage.storage_policy create_spec_vm_home_storage_policy Storage policy for the virtual machine template's configuration and log files. This attribute was added in vSphere API 6.8.

Optional. If unset, datastore must be specified and the virtual machine template's configuration and log files are created with the default storage policy associated with the datastore.

-.vm_home_storage.storage_policy.policy string Identifier for the storage policy to use. This attribute was added in vSphere API 6.8.

Optional. It is only relevant when type has value USE_SPECIFIED_POLICY. This field is optional and it is only relevant when the value of type is USE_SPECIFIED_POLICY.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.spbm.StorageProfile. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.spbm.StorageProfile.

-.disk_storage create_spec_disk_storage Storage specification for the virtual machine template's disks. This attribute was added in vSphere API 6.8.

Optional. If both disk_storage_overrides and disk_storage are unset, the virtual machine template's disks are placed in the default storage backing associated with the library specified by library.

If disk_storage_overrides is unset and disk_storage is specified, all of the virtual machine template's disks are created with the storage spec specified by disk_storage.

If disk_storage_overrides is specified and disk_storage is unset, disks with identifiers that are not in disk_storage_overrides are placed in the default storage backing associated with the library specified by library.

If both disk_storage_overrides and disk_storage are specified, disks with identifiers that are not in disk_storage_overrides are created with the storage spec specified by disk_storage.

.
-.disk_storage.datastore string Identifier for the datastore associated with a virtual machine template's disk. This attribute was added in vSphere API 6.8.

Optional. This field is currently required.

If storage_policy is also specified and is incompatible with the datastore, then the disk will be flagged as being out of compliance with the specified storage policy.

. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Datastore. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Datastore.
-.disk_storage.storage_policy create_spec_disk_storage_policy Storage policy for a virtual machine template's disk. This attribute was added in vSphere API 6.8.

Optional. If unset, datastore must be specified and the virtual machine template's disk is created with the default storage policy associated with the datastore.

-.disk_storage.storage_policy.policy string Identifier for the storage policy to use. This attribute was added in vSphere API 6.8.

Optional. It is only relevant when type has value USE_SPECIFIED_POLICY. This field is optional and it is only relevant when the value of type is USE_SPECIFIED_POLICY.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: com.vmware.spbm.StorageProfile. When operations return a value of this structure as a result, the field will be an identifier for the resource type: com.vmware.spbm.StorageProfile.

-.disk_storage_overrides object Storage specification for individual disks in the virtual machine template. This is specified as a mapping between disk identifiers in the source virtual machine and their respective storage specifications. This attribute was added in vSphere API 6.8.

Optional. If both disk_storage_overrides and disk_storage are unset, the virtual machine template's disks are placed in the default storage backing associated with the library specified by library.

If disk_storage_overrides is unset and disk_storage is specified, all of the virtual machine template's disks are created with the storage spec specified by disk_storage.

If disk_storage_overrides is specified and disk_storage is unset, disks with identifiers that are not in disk_storage_overrides are placed in the default storage backing associated with the library specified by library.

If both disk_storage_overrides and disk_storage are specified, disks with identifiers that are not in disk_storage_overrides are created with the storage spec specified by disk_storage.

. When clients pass a value of this structure as a parameter, the key in the field key/value pairs must be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Disk. When operations return a value of this structure as a result, the key in the field key/value pairs will be an identifier for the resource type: com.vmware.vcenter.vm.hardware.Disk.
-.placement create_placement_spec Information used to place the virtual machine template. This attribute was added in vSphere API 6.8.

Optional. This field is currently required. In the future, if this field is unset, the system will place the virtual machine template on a suitable resource.

If specified, each field will be used for placement. If the fields result in disjoint placement, the operation will fail. If the fields along with the placement values of the source virtual machine result in disjoint placement, the operation will fail.

.
-.placement.folder string Virtual machine folder into which the virtual machine template should be placed. This attribute was added in vSphere API 6.8.

Optional. If unset, the virtual machine template will be placed in the same folder as the source virtual machine.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Folder. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Folder.

-.placement.resource_pool string Resource pool into which the virtual machine template should be placed. This attribute was added in vSphere API 6.8.

Optional. If unset, the system will attempt to choose a suitable resource pool for the virtual machine template; if a resource pool cannot be chosen, the library item creation operation will fail.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: ResourcePool. When operations return a value of this structure as a result, the field will be an identifier for the resource type: ResourcePool.

-.placement.host string Host onto which the virtual machine template should be placed. If host and resource_pool are both specified, resource_pool must belong to host. If host and cluster are both specified, host must be a member of cluster. This attribute was added in vSphere API 6.8.

Optional. This field may be unset if resource_pool or cluster is specified. If unset, the system will attempt to choose a suitable host for the virtual machine template; if a host cannot be chosen, the library item creation operation will fail.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: HostSystem. When operations return a value of this structure as a result, the field will be an identifier for the resource type: HostSystem.

-.placement.cluster string Cluster onto which the virtual machine template should be placed. If cluster and resource_pool are both specified, resource_pool must belong to cluster. If cluster and host are both specified, host must be a member of cluster. This attribute was added in vSphere API 6.8.

Optional. If resource_pool or host is specified, it is recommended that this field be unset.When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: ClusterComputeResource. When operations return a value of this structure as a result, the field will be an identifier for the resource type: ClusterComputeResource.