vcenter guest: windows sysprep

The windows_sysprep structure provides all the settings like user details, administrator details, etc that need to applied for a windows guest operating system during customization. This structure was added in vSphere API 7.0.0.0.

Representation:

{
    "domain"{
        "workgroup""string",
        "domain_password""secret string",
        "domain_username""string",
        "domain""string",
        "type""WORKGROUP"
    },
    "gui_run_once_commands"[
        "string",
        "string"
    ],
    "user_data"{
        "computer_name"{
            "prefix""string",
            "type""FIXED",
            "fixed_name""string"
        },
        "full_name""string",
        "product_key""string",
        "organization""string"
    },
    "gui_unattended"{
        "password""secret string",
        "auto_logon_count"1,
        "auto_logon"true,
        "time_zone"1
    }
}

Attributes:

Name Type Description
Required
user_data user_data Personal data pertaining to the owner of the virtual machine. This attribute was added in vSphere API 7.0.0.0.

user_data.computer_name hostname_generator The computer name of the (Windows) virtual machine. A computer name may contain letters (A-Z), numbers(0-9) and hyphens (-) but no spaces or periods (.). The name may not consist entirely of digits. A computer name is restricted to 15 characters in length. If the computer name is longer than 15 characters, it will be truncated to 15 characters. Check vcenter.guest.hostname_generator for various options. This attribute was added in vSphere API 7.0.0.0.

user_data.computer_name.type string The type of the Name Generator. This attribute was added in vSphere API 7.0.0.0.

Specifies different types of Name Generators. This enumeration was added in vSphere API 7.0.0.0. Value is one of:
FIXED: Specifies that a fixed name should be used for the hostname for the virtual machine during the customization. This constant was added in vSphere API 7.0.0.0.
PREFIX: Specifies that a unique name should be generated by concatenating the base string with a number including the network name of the guest.

Virtual machine names are unique across the set of hosts and virtual machines known to the VirtualCenter instance. VirtualCenter tracks the network names of virtual machines as well as hosts. VMware Tools runs in a guest operating system and reports information to VirtualCenter.

. This constant was added in vSphere API 7.0.0.0.
VIRTUAL_MACHINE: Specifies that the VirtualCenter should generate a virtual machine name.

The name is generated from a base prefix comprising the virtual machine entity name. A number is appended, if necessary, to make it unique.

Virtual machine names are unique across the set of hosts and virtual machines known to the VirtualCenter instance. VirtualCenter tracks the network names of the virtual machines as well as hosts. VMware Tools runs in a guest operating system and reports information to VirtualCenter, including the network name of the guest.

. This constant was added in vSphere API 7.0.0.0.
USER_INPUT_REQUIRED: Indicates that the host name is not specified in advance. The user must provide a valid value when the actual customization spec is applied to a virtual machine. This constant was added in vSphere API 7.0.0.0.
user_data.full_name string Full name of the end user. Note that this is not the username but full name specified in "Firstname Lastname" format. This attribute was added in vSphere API 7.0.0.0.

user_data.organization string Name of the organization that owns the computer. This attribute was added in vSphere API 7.0.0.0.

user_data.product_key string The product Key to use for activating Windows guest operating system. This attribute was added in vSphere API 7.0.0.0.

domain.type string The type of network to join after the customization. This attribute was added in vSphere API 7.0.0.0.

Defines the types of network the virtual machine should join to after the customization is completed. This enumeration was added in vSphere API 7.0.0.0. Value is one of:
WORKGROUP: The virtual machine should be be joined to a workgroup. This constant was added in vSphere API 7.0.0.0.
DOMAIN: The virtual machine should be be joined to a domain. This constant was added in vSphere API 7.0.0.0.

gui_unattended gui_unattended Information related to unattended installation. This attribute was added in vSphere API 7.0.0.0.

gui_unattended.auto_logon boolean Flag to determine whether or not the machine automatically logs on as Administrator. See the vcenter.guest.gui_unattended.password property. If vcenter.guest.gui_unattended.auto_logon flag is set, then vcenter.guest.gui_unattended.password must not be unset or the guest customization will fail. This attribute was added in vSphere API 7.0.0.0.

gui_unattended.auto_logon_count long If the vcenter.guest.gui_unattended.auto_logon flag is set, then this property specifies the number of times the machine should automatically log on as Administrator. Generally it should be 1, but if the setup requires a number of reboots, you may want to increase it. This number may be determined by the list of commands. This attribute was added in vSphere API 7.0.0.0.

gui_unattended.time_zone long The time zone index for the virtual machine. Numbers correspond to time zones at https://support.microsoft.com/en-us/help/973627/microsoft-time-zone-index-values. This attribute was added in vSphere API 7.0.0.0.

Optional
gui_run_once_commands string[] A list of commands to run at first user logon, after customizing the guest. These commands are directly mapped to the GuiRunOnce key in the sysprep.xml answer file. These commands are transferred into the sysprep.xml file that VirtualCenter stores on the target virtual disk. For more information about performing unattended installation, check https://technet.microsoft.com/en-us/library/cc771830(v=ws.10).aspx The commands listed here ar executed when a user logs on the first time after customization completes. The logon may be driven by vcenter.guest.gui_unattended.auto_logon setting. These commands are directly mapped to the GuiRunOnce key in the. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset, no commands are run.

user_data.computer_name.fixed_name string The virtual machine name specified by the client. This attribute was added in vSphere API 7.0.0.0.

Optional. It is only relevant when type has value FIXED. This field is optional and it is only relevant when the value of type is FIXED.

user_data.computer_name.prefix string Base prefix, to which a unique number is appended. This attribute was added in vSphere API 7.0.0.0.

Optional. It is only relevant when type has value PREFIX. This field is optional and it is only relevant when the value of type is PREFIX.

domain domain Information needed to join a workgroup or domain. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset, the guest will not be joined to any workgroup or a domain.

domain.workgroup string The workgroup that the virtual machine should join. This attribute was added in vSphere API 7.0.0.0.

Optional. It is only relevant when type has value WORKGROUP. This field is optional and it is only relevant when the value of type is WORKGROUP.

domain.domain string The domain to which the virtual machine should be joined. This attribute was added in vSphere API 7.0.0.0.

Optional. It is only relevant when type has value DOMAIN. This field is optional and it is only relevant when the value of type is DOMAIN.

domain.domain_username string The domain user that has permission to join the domain after virtual machine is joined. This attribute was added in vSphere API 7.0.0.0.

Optional. It is only relevant when type has value DOMAIN. This field is optional and it is only relevant when the value of type is DOMAIN.

domain.domain_password secret The domain user password that has permission to join the vcenter.guest.domain.domain_username after customization. This attribute was added in vSphere API 7.0.0.0.

Optional. It is only relevant when type has value DOMAIN. This field is optional and it is only relevant when the value of type is DOMAIN.

gui_unattended.password secret The new administrator password for the machine. To specify that the password should be set to blank (that is, no password), leave it unset. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset, blank password will be used.