Creating VM Templates Using the Command Line
InstallAnywhere 2021 SP1
The Create InstallAnywhere VM Template Wizard has command-line support, making it possible to include template creation in your automation scripts.
The command line takes in two .properties files as inputs:
Note:All the path entries in the two properties in Windows should use “\\” as a separator, such as:
C:\\Program Files\\InstallAnywhere\\resource\\baseline_vms\\createiso.properties
To create a VM template through the command line, enter the CreateVMTemplate command using the following syntax:
CreateVMTemplate <mode_option> <hypervisor_option> <other_options>
The following categories of command-line options are available for the CreateVMTemplate command:
• | Mode Options |
• | Hypervisor Options |
• | Other Options |
The <mode_options> for the CreateVMTemplate command are as follows:
Option |
Description |
Opens up the GUI mode. |
|
Opens up the Console mode. |
If you leave out the <mode_option> or specify the <mode_option> as -gui, the wizard opens in GUI mode.
The <hypervisor_options> for the CreateVMTemplate command are as follows:
Option |
Description |
To build baseline VM for Amazon. |
|
-vmware |
To build baseline VM for VMware. |
The <other_options> for the CreateVMTemplate command are as follows:
Option |
Description |
-? |
Show this help text. |
-h |
Show this help text. |
-help |
Show this help text. |
Set the locale to the provided language. |
|
Use specified ISO creation properties file. Note:This parameter is applicable to VMware vSphere. |
|
Use specified baseline VM properties file. Note:This parameter is applicable to VMware vSphere. |
|
Use specified baseline VM properties file. Note:This parameter is applicable to VMware vSphere. |
|
When creating a VM template using the command-line utility, a console panel opens and you are prompted to accept a Ubuntu or CentOS end user license agreement. When using automated builds and to accept all EULA agreements in console mode only, you can use the -acceptAllEULA argument. |
Examples of the CreateVMTemplate Command
The following are examples of using the CreateVMTemplate command to create a VM template:
Example |
Code |
Create a baseline VM/ISO modification for VMware |
% CreateVMTemplate -console -vmware -modifyISO <path_of_ISO_creation_properties_file> -createVM <path_of_baseline_vm_properties_file> |
Modify ISO |
% CreateVMTemplate -console -vmware -modifyISO <path_of_ISO_creation_properties_file> Note:The modifyISO option is used to make an ISO (which is not capable of silent installation) capable of silent installation. |
Create a baseline VM with existing ISO (quiet install enabled) |
% CreateVMTemplate -console -vmware -createVM <path_of_baseline_vm_properties_file> |
Create baseline VM for Amazon |
% CreateVMTemplate -console -amazon -createVM <path_of_baseline_vm_properties_file> |
Create baseline VM using cloud image |
% CreateVMTemplate -console -amazon -useCloudImage <path_of_baseline_vm_properties_file> |
Specifying the Protocol in the baselinevm.properties File
A VMware vSphere/vCenter server may be configured to use either http or https protocol. (Refer to the VMware vSphere/vCenter documentation for more information.) The protocol configured for VMware vSphere/vCenter is set in the protocol section of the baselinevm.properties file:
#Protocol to access the host. Set either as "https" or "http". Mandatory
protocol=
By default, InstallAnywhere sets this to https. This change can only be made for console-based builds for the VM Template. The GUI will always try to use https as the protocol.
Sample files for <path_of_baseline_vm_properties_files> can be found in:
$IA_HOME$/resource/build/baselinevm.properties
Sample files for <path_of_ISO_creation_properties_file> can be found in:
$IA_HOME$/resource/build/createiso.properties