i figured out that this is done using the "Server Properties" Tab of a VGJ.
Just need to figure out how this can be done via blcli, or even better the XML that creates the VGJ.
# blcli_execute Virtualization getDBKeyByGroupAndName "/Provisioning/Virtual Guest/Templates" "RedHat 5 x86_64 Template"
# blcli_storeenv jobKey
# blcli_execute Utility storeTargetObject job
# blcli_execute VirtualGuestJob getAssociatedInstanceForServer
# blcli_execute Utility setTargetObject
# blcli_execute Utility storeTargetObject psi
# blcli_execute PropertySetInstance setPropertyValueByPSI NAMED_OBJECT=psi AIX_SSH_CONFIG_HOME "/test"
# ## could put other property sets here
# blcli_execute PropertySetInstance update NAMED_OBJECT=psi
# blcli_execute Utility setTargetObject job
# blcli_execute VirtualGuestJob setAssociatedInstanceForServer NAMED_OBJECT=psi
# blcli_execute Job update NAMED_OBJECT=job
this might break things so don't do it in prod i'm checking w/ some folks if this is the only way or not. i'd also make an idea to make this part of the xml.
Steffen, could you show me how you used this in context? Say I'm using Virtualization createVirtualGuest to create a job named Provision_Server_A, how would you call it and when? After creating the VGJ but before running it?
i think you need to run this after you run the createVirtualGuest since the PSI and the VGP/J aren't going to exist yet.
Right, so after the VGJ is created and saved, but before it runs. So I need to set the "<ExecuteNow>" tag to false in its XML, and run it with another command after. Correct?
Yeah, then get the new job key after the changes and run that.
As this is working....is this a safe way going forward ?
Yeah – it seems to be ok.
It looks like you have already solved your XML generation. Since we use VGJ and baremetal provisioning, we set the properties on the file that is used for blcli provision provisiondevice command. To use that you just key in
echo Server.Property.STAGING_DIR="/var/tmp/stage" >> $PROP_FILE_NAME
echo Server.Property.RSCD_DIR="/opt/bsa/bladelogic/NSH" >> $PROP_FILE_NAME
blcli_execute Provision provisionDevice $SP_ID $MAC_ADDR $ACL_TEMPLATE_ID file:$PROP_FILE_NAME
we also set the execute now to false and then do a
blcli_execute Virtualization createVirtualGuest "$DIR_XML/$BUILD_HOST-$SERVER_CATEGORY"
the result of the command has the key of job created. Store that to a variable by using store env
blcli_execute Virtualization getDBKeyByGroupAndName $JOB_FOLDER $JOB_NAME
blcli_execute Job executeJobAndWait $JOB_KEY
another curiosity question, how do you extract the groupid for a vm template programmatically?
apologies, posted on the wrong thread.