6.1 Understanding Autoprep

In the PlateSpin Orchestrate Development Client, “autoprep” refers to the function of preparing unique network settings for a Linux VM so that VM can be provisioned by its provisioning adapter without creating network conflicts and without customizing other network-related settings.

As the administrator, you can set facts in the PlateSpin Orchestrate Development Client that can later be applied to a VM clone during a Provision or a Clone action from a VM template. You can also use the Personalize action to manually apply autoprep facts to an existing VM.

This section includes the following information:

6.1.1 How Autoprep Works

The vmprep job always runs when you clone or provision from a VM template. The job prepares the root disk image of the VM with the defined autoprep settings. On a Linux system, the global autoprep settings for a VM are stored in various configuration files in the /etc directory. For example, the hostname is stored in /etc/HOSTNAME. Global network properties are stored in /etc/sysconfig/network/config and in /etc/sysconfig/network/dhcp. Per-NIC properties are written to the various /etc/sysconfig/network/ifcfg.* scripts, with one for each virtual NIC.

The vmprep job attempts to identify the disk image with the root partition, then mounts that partition and starts scanning the configuration files to make the necessary changes to the VM configuration file settings.

If the Use Autoprep check box in the VM Client or the Use Autoprep check box in the Development Client is not selected, the vmprep job still runs, but only to change the name of the Orchestrate Agent (if installed) on the VM.

If you want a full autoprep with system config changes when cloning or provisioning from template, you need to select the Use Autoprep check box in the VM Client or the Use Autoprep check box in the Development Client.

For Linux VMs, autoprep mounts the VM image’s root disk image and edits the appropriate files in the /etc/ directory to make the desired configuration changes. This might include adding network interface configurations to the network configuration scripts. The changes take effect when the VM starts again.

6.1.2 Setting Autoprep Facts in the Development Client

You can use the Development Client to configure the facts for autoprep of a VM. This section includes information about the Development Client interface where those facts are set.

When you select a Linux VM object in the Explorer tree of the Development Client, click the Info/Groups tab to open the Info Groups page, then scroll down to the Provisioning Information panel of this page. Open the Linux Autoprep Config panel and the Network Autoprep Config panels.

Figure 6-1 The Autoprep Sections of the Info/Groups Page of a VM Template Object

Linux VMs that you clone can be personalized and prepared for provisioning by configuring the facts in this panel. Click Define on each field if the value has not been previously configured.

NOTE:When you change any of the settings in this panel, you need to right-click the VM and select Personalize for the changes to take effect. This action is in contrast to right-clicking a template, which can apply these settings during a provision or clone operation.

This section also contains this information:

Linux Autoprep Config

The settings located in the Linux Autoprep Config panel are global to a configuration of a Linux VM and are not specific to a particular network adapter.

NOTE:It is not mandatory to define these facts. If they are left undefined, they are not applied to the “autoprepped” VM.

  • Linux Computer Name: The network host name of the new VM. If you specify an asterisk ( * ), the current Grid object ID (resource.id) of the new VM is used.

    The Linux Computer Name should be the unqualified computer name without the DNS domain suffix, such as webserver instead of webserver.acme.com.

    In the Fact Editor, this fact is listed as resource.provisioner.autoprep.linuxglobal.ComputerName:

    <fact name="resource.provisioner.autoprep.linuxglobal.ComputerName" value="" type="String" />
    
  • Linux Domain: The network domain name where the new VM is a member.

    This field should contain the default DNS domain for the host, such as acme.com.

    In the Fact Editor, this fact is listed as resource.provisioner.autoprep.linuxglobal.Domain:

    <fact name="resource.provisioner.autoprep.linuxglobal.Domain" value="" type="String" />
    

Network Autoprep Config

This section includes the following fields:

  • DNS Server IP Addresses: The list of DNS Servers for name for lookup. This setting is only for cloning/personalize actions. For Linux, it should be set only in the VM facts, not in the vNIC facts.

    In the Fact Editor, this fact is listed as an array:

    <fact name="resource.provisioner.autoprep.DNSServers">
      <array>
        <string></string>
      </array>
    </fact>
    
  • DNS Suffixes: The list of suffixes to append to a name for lookup. This setting is only for cloning/personalize actions. For Linux, it should be set only in the VM facts, not in the vNIC facts.

    <fact name="resource.provisioner.autoprep.DNSSuffixes">
      <array type="String">
      </array>
    </fact>
    
  • Gateway IP Addresses: The list of Internet gateways available to this VM. This setting is only for cloning/personalize actions. For Linux, it should be set only in the VM facts, not in the vNIC facts.

    In the Fact Editor, this fact is listed as an array:

    <fact name="resource.provisioner.autoprep.Gateways">
      <array>
        <string></string>
      </array>
    </fact>
    

Defining Autoprep/Sysprep Network Adapter Facts on the vNIC Object

VMs can be prepared for provisioning by configuring the facts in either the Autoprep Network Adapter subpanel (Windows VMs) of the vNIC Info/Groups panel or the Sysprep Network Adapter subpanel (Linux VMs). Click Define on each field if the value has not been previously configured.

NOTE:When you change any of the settings in this panel, you need to right-click the VM and select Personalize for the changes to take effect.

  • MAC Address: The MAC address of the interface. Specify an asterisk (*) or specify no setting at all to generate a new MAC address. If the value is not set, the existing vnic.mac is used.

    IMPORTANT:An unset MAC Address fact generates a new MAC address. This is contrary to the current tooltip text.

    In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.MACAddress:

    <fact name="vnic.provisioner.autoprep.MACAddress" value="" type="String" />
    
  • Use DHCP: When this check box is selected (it has a value of true), the VM is configured to retrieve its network settings from a DHCP server. If the check box is not selected (it has value of false), you should make sure that the IP address, subnet mask, and gateway address facts are defined. In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.UseDHCP:

    <fact name="vnic.provisioner.autoprep.UseDHCP" value="false" type="Boolean" />
    
  • IP Address: The IP address for the adapter.

    In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.IPAddress:

    <fact name="vnic.provisioner.autoprep.IPAddress" value="" type="String" />
    
  • Subnet Mask: The subnet mask for this adapter.

    In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.subnetMask:

    <fact name="vnic.provisioner.autoprep.subnetMask" value="" type="String" />
    
  • Gateway IP Addresses: (Windows only) A list of the gateway IP addresses available to the interface.

    In the Fact Editor, this fact is listed as an array:

    <fact name="vnic.provisioner.autoprep.Gateways">
      <array type="String">
      </array>
    </fact>
    

    You can edit this array by clicking the button to open an array editor. In this dialog box, you can add or remove the IP address or change its order in the array of element choices.

  • DNS from DHCP: When this check box is selected (it has a value of true), the SUSE VM is configured to retrieve its DNS server settings from DHCP.

    In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.DNSFromDHCP:

    <fact name="vnic.provisioner.autoprep.DNSFromDHCP" value="false" type="Boolean" />
    
  • DNS Server IP Addresses: (Windows VM only) The adapter’s list of DNS servers used for name lookup.

    In the Fact Editor, this fact is listed as an array:

    <fact name="vnic.provisioner.autoprep.DNSServers">
      <array type="String">
      </array>
    </fact>
    
  • DNS Domain: (Windows VM only) The adapter’s DNS domain name.

    In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.DNSDomain:

    <fact name="vnic.provisioner.autoprep.DNSDomain" value="" type="String" />
    
  • Primary WINS Server: (Windows VM only) The name of the adapter’s primary WINS server.

    In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.primaryWINS:

    <fact name="vnic.provisioner.autoprep.primaryWINS" value="" type="String" />
    
  • Secondary WINS Server: (Windows VM only) The name of the adapter’s secondary WINS server.

    In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.secondaryWINS:

    <fact name="vnic.provisioner.autoprep.secondaryWINS" value="" type="String" />
    
  • DNS Suffixes: Although it is possible to enter information in this field, it is unused.

  • NetBIOS: (Windows VM only) The NetBIOS options for this VM. Options include:

    • EnableNetBIOSviaDhcp

    • EnableNetBIOS

    • DisableNetBIOS

    In the Fact Editor, this fact is listed as vnic.provisioner.autoprep.netBIOS:

    <fact name="vnic.provisioner.autoprep.netBIOS" value="" type="String" />
    

NOTE:Although you can define individual static settings to be applied to these adapters, autoprep can be useful for provisioning multiple clones with unique, autogenerated MAC addresses and DHCP-defined IP addresses (even though the VM clones are copies of the same VM template OS image) by coupling the autoprep settings on the VM with the autoprep settings on the vNIC object associated with the VM, thus avoiding network conflicts. For more information about vNIC autoprep settings, see Defining Autoprep/Sysprep Network Adapter Facts on the vNIC Object.

6.1.3 Applying Autoprep Facts

The PlateSpin Orchestrate Server applies the autoprep facts by launching the vmprep job when the facts are defined. This job runs automatically and applies the appropriate facts to a VM in the following situations:

  • When a Personalize action is run on any non-template VM. (See Table 2-2).

    On VMs managed by Xen and vSphere, running the Personalize action on a templated VM is not supported. Running this action results in failure because it is not supported in the underlying system. When you clone or provision from a templated VM, select the Use Autoprep check box.

  • When a VM clone is created by initiating the Clone action on a VM template.

    Select the Use Autoprep check box in the VM Client or the Use Autoprep check box in the Development Client if autoprep facts are to be used when the Clone action is initiated.

  • When a VM clone is created by initiating a Provision action on a VM template.

    Select the Use Autoprep check box in the VM Client or the Use Autoprep check box in the Development Client if autoprep facts are to be used when the Clone action is initiated.

6.1.4 Example Autoprep Scenarios

Scenario 1: You want to create 25 dynamic VM instances to test job provisioning. You will never use these instances again.

You create a VM template by right-clicking a VM, then you select Create Template. When the VM Template is created in the Explorer Tree, you define its autoprep facts in the Info/Groups page of the vNIC object by specifying an asterisk in the MAC Address field, then you select the Use DHCP check box. This lets the Development Client autogenerate the MAC address and retrieve network data from the DHCP server. For information about setting autoprep facts on each vNIC, see The Virtual NIC Info Panel in the PlateSpin Orchestrate 2.5 Development Client Reference.

When the autoprep facts are defined, you provision this template. You right-click the template object and select Provision, then in the Provision VM dialog box, you specify that you want to provision (create) 25 new VM instances from this template. Provisioning automatically applies the autoprep facts from the template if the Use Autoprep check box is selected.

Scenario 2: You have created three VM clones in your grid and you want to provision those clones. You want to ensure that the MAC address and other key network information for each clone is unique, even though each clone is a copy of the same OS image. These clones are to be detached later and used for such things as mail servers and Web servers. When the clones were first created, autoprep facts were applied, but now you have changed those facts by adding static IP addresses, subnet masks, and gateway addresses for each. Each clone must be “personalized” because of this change to basic network identifiers.

To personalize, you select each Clone object, then define the adapter-specific settings on the Info/Groups page of each of the VM’s vNICs by entering IP addresses, DNS suffixes, and gateway addresses for each vNIC in the Network Autoprep Config subpanel. When you have defined the autoprep facts on each VM clone, you right-click each Clone object in turn and select Personalize to apply the new network configuration.

For more information, see Changing a Virtual Machine Template Clone to an Instance and Personalize.

6.1.5 Known Autoprep Limitations

There are some limitations that you need to be aware of when you use autoprep:

  • Currently, the Gateway IP Addresses setting in the Info/Groups tab for a VM object is available in a list box.

    Because the Linux VM OS accepts only one default gateway, it accepts only the first setting in the list as the actual gateway IP address. The other settings are ignored.

  • Before performing an autoprep operation on a vSphere VM, you must first configure the VM to have the VMware Tools guest OS package installed. The VMware administrator must also have configured the Virtual Center server to allow sysprep. For more information, see the VMware vSphere Online Library.

  • When a VM is autoprepped in vSphere, it goes into a “customization pending” state that is not cleared until the VM successfully starts and the prep completes. This means that subsequent attempts to autoprep fail until the VM reboots and the previous prep completes. There is no way to directly reverse customization in vSphere.

  • Customization of a vSphere VM for autoprep does the following with regard to the MAC address:

    • If the MAC address field in the Development Client autoprep subpanel is empty (or if an asterisk is entered), PlateSpin Orchestrate auto-generates a new MAC address.

    • If the MAC address value is in the range 00:50:56:00:00:0000:50:56:3f:ff:ff, PlateSpin Orchestrate statically assigns the MAC address.

    • If the MAC address value is not empty and is outside the defined range, PlateSpin Orchestrate attempts to assign the MAC address, but it might be reassigned by vSphere if it is determined to be duplicate.

    For more information, see VMware Data Object - VirtualEthernetCard documentation.

  • The Orchestrate vsphere provisioning adapter checks the setting for the host name. If the host name is not set, the setting defaults to the Orchestrate VM name.

  • If a Hyper-V VM is running during the discover process, it fails to discover the resource.os.family fact. This prevents the Development Client from displaying the Sysprep and Autoprep options section on the Info/Groups tab for the VM.

    NOTE:If the VM not running when the discovery occurs, the hyperv provisioning adapter discovers resource.os.family itself.

    If you create a template from this VM, the resource.os.family fact is discovered and populated on the VM template admin view.

    To display the sysprep/autoprep settings on a Hyper-V VM:

    1. Shut down the Hyper-V VM that has the problem.

    2. From the Explorer Tree, right-click the VM you shut down, then select Resync State.

    3. In the Development Client, Shift+click the Refresh icon or restart the Development Client to refresh all of the objects and their facts in the Resource admin view.