VMware Cloud Community
UofS
Enthusiast
Enthusiast

Preventing hostname changes

HI,

I want to have a blocking task that checks to ensure a vcd vm can be named something before proceeding with the name change.

I have created a blocking task and see that the entityVM ComputerName requested shows the current name not the requested name.

How can I extract the entered name before actually letting the name change take effect before checking?

Dion

0 Kudos
8 Replies
Burke-
VMware Employee
VMware Employee

You should get the new Notifications Package (for vCO 5.1 and vCloud Director 5.1).. that has a workflow called "Approve Modify VM Configuration" that includes checks against the vm Name... while it doesn't do EXACTLY what you're asking, it certainly should have the code you need to accomplish your goal!

Notification Package: http://communities.vmware.com/docs/DOC-20446

Documentation: See the document link above and within that doc.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
UofS
Enthusiast
Enthusiast

As I am at 5.0 and 1.5, I will have to wait then I guess. Smiley Sad  We are still waiting for a 3rd party vendor to be compatible with v5.1.

Thanks.

0 Kudos
Burke-
VMware Employee
VMware Employee

If I were you, I would spin up a 5.1 appliance on a test server (even on Workstation if necessary) and import the package to see the content of the workflow. The scripted evaluation of the blocking task in the "scaffold" Scriptable task will give you a really good idea of how to move forward..

Also, if you haven't started off by using the older version of our notitications package then you've done too much work on your own Smiley Wink

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos
UofS
Enthusiast
Enthusiast

OK, just to clarify what I am reading here so I can pass this back to our team:

I will not be able to implement a "hostname rename modification" blocking task and obtain the users selected hostname until I am at VCD 5.1 AND Orch 5.1 ... right?

dion

0 Kudos
Burke-
VMware Employee
VMware Employee

No, this CAN be implemented in your current versions, you just need to review the code in the 5.1 package and implement same (or very nearly same) in the current version you are running..

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you!

Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator
for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
UofS
Enthusiast
Enthusiast

Thanks,

Can the vCO 5.1 appliance be run without a vCenter 5.1 SSO server?  Or are they independent?

0 Kudos
igorstoyanov
VMware Employee
VMware Employee

vCO5.1 is (or could be) integrated with vCenter 5.1 SSO . However, you can use vCO5.1 as a stand alone product. The vCO 5.1 Appliance by default doesn't not integrated with vCenter5.1 and SSO and works out of the box.

Regards,

Igor.

Visit http://blogs.vmware.com/orchestrator for the latest in Cloud Orchestration.
0 Kudos
UofS
Enthusiast
Enthusiast

Deploying vco 5.1 from the OVF was dead simple and easy to login.

I got the code and was able to get a successful response.

Here is my code pieced from the example in the 5.1 vCO:

// Get old vm hostname
var vmXML = oldVm.toXml();

var vmDoc = new XML(vmXML);
var oldComputerName = vmDoc.GuestCustomizationSection.ComputerName.toString();

// Get the new hostname from task
if (blockingTask != null) {
    var task = vcdHost.getEntityByReference(VclFinderType.TASK, blockingTask.getTask());
    System.log("task.href : " + task.href);
    //System.log("Task XML: \n" + task.toXml());
    var taskXML = task.toXml();
}

oldVm.updateInternalState();

var taskDoc = new XML(taskXML);
default xml namespace = taskDoc.namespace();
System.log("=========== Updated Info ==========");
var newComputerName = taskDoc.Params.GuestCustomizationSection.ComputerName.toString();
System.log("New Computer Name: "+newComputerName);

Thanks for the help.

0 Kudos