vcenter guest: linux configuration

Guest customization Settings to customize a Linux guest operating system.

The linux_configuration structure contains settings that identify a Linux machine in the same way that the vcenter.guest.windows_configuration structure identifies a Windows machine.

. This structure was added in vSphere API 7.0.0.0.

Representation:

{
    "hostname"{
        "prefix""string",
        "type""FIXED",
        "fixed_name""string"
    },
    "script_text""string",
    "domain""string",
    "time_zone""string"
}

Attributes:

Name Type Description
Required
hostname hostname_generator The network host name of the Linux virtual machine. This attribute was added in vSphere API 7.0.0.0.

hostname.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.
domain string The fully qualified domain name. This attribute was added in vSphere API 7.0.0.0.

Optional
hostname.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.

hostname.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.

time_zone string The case-sensitive time zone, such as Europe/Sofia. Valid time zone values are based on the tz (time zone) database used by Linux. The values are strings (string) in the form "Area/Location," in which Area is a continent or ocean name, and Location is the city, island, or other regional designation.

See the https://kb.vmware.com/kb/2145518 for a list of supported time zones for different versions in Linux.

. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset, time zone is not modified inside guest operating system.

script_text string The script to run before and after Linux guest customization.
The max size of the script is 1500 bytes. As long as the script (shell, perl, python...) has the right "#!" in the header, it is supported. The caller should not assume any environment variables when the script is run.

The script is invoked by the customization engine using the command line: 1) with argument "precustomization" before customization, 2) with argument "postcustomization" after customization. The script should parse this argument and implement pre-customization or post-customization task code details in the corresponding block.

A Linux shell script example:

#!/bin/sh
if [ x$1 == x"precustomization" ]; then
echo "Do Precustomization tasks"
#code for pre-customization actions...
elif [ x$1 == x"postcustomization" ]; then
echo "Do Postcustomization tasks"
#code for post-customization actions...
fi

. This attribute was added in vSphere API 7.0.0.0.

Optional. If unset, no script will be executed.