So, I'm creating a vApp from a template, like so:
However once the machine boots up, it does not run Sysprep but instead I get a logon screen without the new settings.
If I comment out the lines to deploy the vApp and Vm it creates fine, as previously. However I can then choose "Power on and Force Recustomization" through the API, which forces Sysprep to run and changes settings as expected.
Is there no way of performing this forced reconfiguration on poweron through the API? I can find people referring to this limitation in v1.0, but surely this is a common thing for people to require?
Cheers
O.
Hi,
Deploying with force customization option is not available in vCloud API 1.0.
http://www.vmware.com/pdf/vcd_10_api_guide.pdf - Pg No 175.
Hi,
Deploying with force customization option is not available in vCloud API 1.0.
http://www.vmware.com/pdf/vcd_10_api_guide.pdf - Pg No 175.
Excellent, something to be implemented soon enough I hope?
Hi,
Yes, the 'forceCustomization' attribute was added to the <DeployVAppParams> object in version 1.5 of vCD which was released a couple of weeks ago
Regards,
Todor Todorov
Ah, perhaps that's the issue I'm having - we currently have a v1.0 setup and someone's currently building me a v1.5 one.
I shall get on with that
After several retries and reading i managed to get this working through REST POST method...
string url = vm.Resource.href + @"/action/deploy";
string body = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DeployVAppParams xmlns=\"http://www.vmware.com/vcloud/v1.5\" powerOn=" + "\"" + "true" + "\"" + " deploymentLeaseSeconds=" + "\"" + orgLeaseSettings.DeploymentLeaseSeconds.ToString() + "\"" + " forceCustomization=" + "\"" + ForceCustomization.ToString().ToLower() + "\"" + "/>";
string contentType = "application/vnd.vmware.vcloud.deployVAppParams+xml";
Response rp = com.vmware.vcloud.sdk.utility.RestUtil.Post(vCloudSession, url, body, contentType, "UTF-8");
XmlDocument doc = new XmlDocument();
try
{
doc.LoadXml(rp.ResponseXml);
XmlNode task_node = null;
foreach (XmlNode temp in doc.ChildNodes)
{
if (temp.Name == "Task")
{
task_node = temp;
break;
}
}
if (task_node != null)
{
string task_id = task_node.Attributes["id"].Value;
Task t1 = Task.GetTaskById(vCloudSession, task_id);
t1.WaitForTask(timeout);
}
}
catch (Exception e1)
{
retval =
false;
failure_reason =
"RestUtil returned invalid POST response.";
return retval;
}