ProvisionJob - createProvisionJob
ProvisionJob - createProvisionJob
Description :
This command creates a Provision Job, and returns the DBKey of the newly created job. This command does not execute the job. To execute the job, use one of the commands in the Job namespace, for example Job : execute .
The serverPropertyInstance argument lets you set server property values on the newly provisioned server. To use this argument, you need to create an instance of the PROVSERVER class before you run the createProvisionJob command. The PROVSERVER class contains the same server properties as the Server class. When you create the PROVSERVER instance, you can set various server properties to the values you want this job to apply to the newly provisioned server.
For example, you might want to set the STAGING_DIR property. You might also want to add a property called SITE and set it to the geographical location where you are provisioning devices.
To create a PROVSERVER instance and set values, you can use the PropertyInstance : createInstance command.
If you do not want to use the serverPropertyInstance argument to set server properties, set the argument to null. In that case, the newly provisioned server will have default server property values.
The inputFile argument points to a file that contains entries related to both the system package and the Provision Job. You must provide an input file, but the input file can be empty (or contain just a space). If you pass in an empty input file, the job uses values from the system package, and uses the default boot image that is associated with the device.
Suppose that for a particular job, you want to override the value of a system package property. In the input file, you can do this by setting the local property to use when you run this job.
In the input file, the general syntax for doing this is:
SystemPackage.LocalProperty.prop_name=value
where prop_name is the name of the system package property. Example:
SystemPackage.LocalProperty.DATA_STORE=Class://SystemObject//PXE Datastore/my_instance
The job-related input file entries are:
-- Job.Provision.BootImage=Boot Image ID to be used in the job. To get the boot image ID, use the Provision : listAllBootImages command.
-- Job.Provision.PauseDuration=Pause duration for each step in the job, expressed in seconds.
-- Job.Provision.IsPauseAtEachStep=Pause at each step in the job. (true/false)
-- Job.Provision.PerformCleanup=Perform Cleanup of NIM resources.Valid only for provisioning of NIM devices. (true/false)
The network-related input file entries are:
- Network.DHCPEnabled=[true or false], to obtain the IPv4 address automatically
- Network.IPV6DHCPENABLED=[true or false], to obtain the IPv6 address automatically
The iDRAC entries are:
- IDRACJob.UseLocalDrivers=TRUE/FALSE
If TRUE, the job uses unpack and attach, if FALSE, the job uses drivers from the datastore. Note that unpack and attach operations are not supported for Win2k3 system packages and x64 system packages.
- IDRACJob.BootMediaType=0/1
If 0, the job selects boot from network ISO. If 1, the job selects boot from vflash.
- IDRACJob.OSForDrivers=os_name
For os_name, specify the operating system, using one of the following strings:
- Windows Server(R) 2003 R2 with SP2
- Windows Server(R) 2003, x64 R2 with SP2
- Windows Server(R) 2008
- Windows Server(R) 2008, x64
- Windows Server(R) 2008 R2
- Windows(R) Small Business Server 2008
- Windows(R) Essential Business Server 2008
- Red Hat Enterprise Linux 4.7 32-bit
- Red Hat Linux Enterprise 4.7 64-bit
- Red Hat Enterprise Linux 4.8 32-bit
- Red Hat Linux Enterprise 4.8 64-bit
- Red Hat Enterprise Linux 5.3 32-bit
- Red Hat Enterprise Linux 5.3 64-bit
- RedHat Enterprise Linux 6.0
- SUSE Linux Enterprise Server 10 SP2 64-bit
- SUSE Linux Enterprise Server 11 64-bit
- ESX 3.5
- ESXi 3.5
- ESX 4.0
- ESXi 4.0
- Hyper-V(TM) Server
- Hyper-V(TM) Server R2
- Citrix XenServer(TM) Dell Edition
Here is a sample input file: c:/ProvJobInput.txt
SystemPackage.LocalProperty.DATA_STORE=Class://SystemObject/DataStore/Pxe Datastore/192.168.100.181
Job.Provision.BootImage=100
Job.Provision.PauseDuration=0
Job.Provision.IsPauseAtEachStep=true
IDRACJob.UseLocalDrivers=true
IDRACJob.BootMediaType=1
IDRACJob.OSForDrivers=Windows Server(R) 2003 R2 with SP2
The targetFile argument points to a CSV file that contains information about the devices you want to provision. You must supply a target file. If you do not want to specify target devices when you use this command to create the job, you still need to create an "empty" target file (header row only) and pass in its location with the targetFile argument.
The first line of the target file must contain the following header row:
MAC_ADDRESS,COMPUTER_NAME,OM_SERVER_NAME,IP_ADDRESS,SUBNET_MASK,DEFAULT_GATEWAY,OS_LICENSE,NIM_CLIENT_NAME,Ipv6_ADDRESS,IPv6_SUBNET_LENGTH,IPv6_DEFAULT_GATEWAY
Each subsequent line contains information about a device. Each device line must include a MAC_ADDRESS entry, in upper case. Other entries are optional, but you must include commas to indicate missing entries, as shown in the example device lines below. The last three entries can be used to specify IPv6-enabled devices.
The first line in the example includes everything except NIM_CLIENT_NAME. Note the trailing comma that indicates the missing entry. The second line in the example includes just the MAC_ADDRESSS and OS_LICENSE. The third line has just the MAC_ADDRESS.
MAC_ADDRESS,COMPUTER_NAME,OM_SERVER_NAME,IP_ADDRESS,SUBNET_MASK,DEFAULT_GATEWAY,OS_LICENSE,NIM_CLIENT_NAME
22-22-22-22-22-22,comp-foo,comp-foo,192.168.11.12,255.255.255.0,192.168.11.1,KKDDE-UURYT-PPELK-MFJHG,
11-11-11-11-11-11,,,,,,FSDSA-SDJHS-SDSKD-KJERK,
12-12-12-12-12-12,,,,,,,
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
---|---|---|
jobGroup | String | Parent group for this job. |
jobName | String | Name of the job. |
jobDescription | String | Job description |
systempackageDbkey | DBKey | DBKey of the system package you want this job to use. |
serverPropertyInstance | String | An instance of the PROVSERVER property class. This instance specifies the server properties that you want set on the newly provisioned server. If you set this to null, the newly provisioned server has default server property values. |
aclTemplateId | Integer | ACL template to apply to the server. If you want to use default ACLs, set this to 0. |
inputFile | String | URL to the input file that contains system package properties and job properties. |
targetFile | String | URL to a CSV file that contains information about the devices you want to provision. |
Example
The following example creates a ProvisionJob.
Script
JOB_NAME="win2k3_prov"
JOB_DESCRIPTION="Provision Windows 2003 servers"
# Get the DBKey of the system package you want to use for this job
SYS_PACK_KEY=`blcli SystemPackage getDBKeyByGroupAndName "/SysPackGrp/Windows" "Win2k3"`
# Create an instance of the PROVSERVER class and override some values
WIN2K3_INSTANCE=`blcli PropertyInstance createInstance Class://SystemObject/Server/PROVSERVER PropsForWin2k3 "Server properties for provisioning Win2K3 machines" "intProp=1,strProp=my value,decVal=0.0"
WIN2K3_INSTANCE="Class://SystemObject/Server/PROVSERVER/PropsForWin2k3"
# Get the ID of the ACL template that you want to apply to the servers that you are provisioning
ACL_TEMPLATE_ID=`blcli BlAclTemplate nameToId myACL_Template"
INPUT_FILE="file:///c:/ProvJobInput.txt"
TARGET_FILE="file:///c:/target.csv"
# Create the Provision Job
JOB_KEY=`blcli ProvisionJob createProvisionJob "$JOB_GROUP" "$JOB_NAME" "$JOB_DESCRIPTION" $SYS_PACK_KEY "$WIN2K3_INSTANCE" $ACL_TEMPLATE_ID "$INPUT_FILE" "$TARGET_FILE"'