5.2 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:

5.2.1 Example Autoprep Scenarios

Scenario 1: You want to create 25 dynamic VM instances to test job provisioning. You will never use these instances again, so you will not personalize them.

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 by entering an asterisk in the MAC Address field, and 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.

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.

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 by entering IP addresses, subnet masks, and gateway addresses for each adapter. 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.

5.2.2 How Autoprep Works

The vmprep job always runs when you clone or provision from a VM template. The job prepares the first disk image of the VM with the defined Autoprep settings. On a Linux system, most of these settings are stored in configuration files in the /etc/hosts or /etc/sysconfig directories. The vmprep job identifies the first listed disk for the VM, attempts to find the root partition for that disk, then mounts that partition and starts scanning the configuration files to make the necessary changes to the VM configuration file settings.

Generally, the vmprep job looks at each Autoprep fact independently, with the following exceptions:

  • If the resource.provisioner.autoprep.adapters.MACaddress fact is undefined, Autoprep assumes an asterisk, and autogenerates a MAC address for the template or clone.

  • If the resource.provisioner.autoprep.adapters.UseDHCP fact is undefined, Autoprep looks at resource.provisioner.autoprep.adapters.IPAddress fact. If both are undefined, Autoprep assumes it can use DHCP. If the IP address is defined, Autoprep assumes the address is static, and accepts the entered address.

  • If the first network adapter does not specify a gateway, but the second network adapter does specify a gateway, the first network adapter is configured to use the gateway from the second network adapter.