HowTo

Renaming a datastore through vCO

I was in need of automatically renaming a generic datastore name in one of my host deployment workflows and found that the renameDatastore() method was deprecated (Thanks Jörg!) and that we are to use rename_Task().  The rename_Task() method is one that takes any manageable object.  Here is an exert from the API reference:

Rename_Task

Renames this managed entity.

Any % (percent) character used in this name parameter must be escaped, unless it is used to start an escape sequence. Clients may also escape any other characters in this name parameter.
See name

Required Privileges
When object is VirtualMachine - VirtualMachine.Config.Rename
When object is Datacenter - Datacenter.Rename
When object is Folder - Folder.Rename
When object is VirtualApp - VApp.Rename
When object is ResourcePool - Resource.RenamePool
When object is ClusterComputeResource - Host.Inventory.RenameCluster
When object is DistributedVirtualSwitch - DVSwitch.Modify
When object is DistributedVirtualPortgroup - DVPortgroup.Modify
When object is Datastore - Datastore.Rename
When object is Network - System.Read

So I implemented the following code into a new scriptable task within my workflow:

1
2
3
4
5
6
7
8
var hostDatastoreSystem = VcPlugin.toManagedObject( host, host.configManager.datastoreSystem );

// Rename datastore on host matching Datastore
for each (var datastore in hostDatastoreSystem.datastore) {
if(datastore.name == "Datastore"){
datastore.rename_Task("newDsName");
System.log("Changing datastore name to "+newDsName);
}

Another thing I realized was that the API explorer within vCO is not always as forthcoming with information so a word to the wise, always check the API reference (http://pubs.vmware.com/vsphere-50/topic/com.vmware.wssdk.apiref.doc_50/right-pane.html) for more detailed information.

vCO Webviews/Perspectives Default Values Issue

So today I was running some workflows that will be needed in the next week or so and found that they suddenly did not work in Webviews or Perspectives.  The only change recently was my upgrade of my vCO appliances.  For some odd reason the auto-generated default values I would create in the workflow would not populate.  After some soul searching and asking on VMTN, I was directed to a KB that was released recently by Christophe Decanini (@vCOTeam).

Some issues occur in vCenter Orchestrator 4.2.1 weboperator Web view. For example, when you use default values for input parameters in a workflow, run the workflow from the weboperator Web view, and then you change some of the parameters, the default values are not updated correctly. Another issue is that you cannot schedule a workflow by using the weboperator Web view.

You can get to the KB article here: http://kb.vmware.com/kb/2015178

The fix is a simple replace of a jar file and restart of the Orchestrator services.

 

vCO vApp Upgrade Issue

So I decided to remediate my vCO vApp to the latest version, 4.2.1.  Everything went smooth after attaching the baseline that I created to upgrade it through VUM.  Upgrade looked successful, went to login and received:

Can’t connect to host…

After re-reading the release notes, I noticed the first Known Issue for Installation was:

After you upgrade the Orchestrator appliance to version 4.2.1, the Orchestrator server might not start automatically

So following the workaround provided I proceeded to:

    • Log in to the appliance home page.
    • Click Orchestrator Configuration, and log in.
    • Click the Database tab on the left, and click Update database.
    • Click the Startup Options tab on the left.
    • Click Start service.

This didn’t seem to resolve the issue for me.  I was still unable to login.  So what to do…I decided that I may need to clear all temporary files on the server.  You can do this by:

    • Log in to the appliance home page.
    • Click Orchestrator Configuration, and log in.
    • Click the Startup Options tab on the left.
    • Click Stop service.
    • Click the Troubleshooting tab on the left.
    • Click Clean directories.
    • Click the Startup Options tab on the left again.
    • Click Start service.

Viola!  This seem to resolve the issue I was having of logging in via the Orchestrator Client.

vCenter Orchestrator: Operation Automate – Part Five

Now that we have a completely working automation workflow with some cool little auto-generated stuff in it, we can move to the presentation of the workflow.  Think of this as the GUI for the workflow.  There are two different presentation views controlled by a single presentation configuration view.  These are:

    • vCO Client Workflow Execution View
    • Web Workflow Execution View

The presentation of a workflow is controlled through essentially an advanced form editor, in my opinion.  This editor is found within the Edit workflow portion of the vCO client.  To get to this you just go edit your workflow as usual and select the Presentation tab in the editor.  I won’t go into too much detail as there isn’t much to really go into.  You can play around with the settings within the presentation section and run the workflow to see what it does.  Try running the workflow from the vCO client and from a webview.  You will see how the form pieces react differently within each type of view.

The presentation of a workflow is important because you give your workflow a polished view to the user executing it.  It can offer a roadmap through the workflow and at the same time give a pleasant experience for the user.  If you would like for a more detailed post about the presentation section then please feel free to say so and I will do my best to accommodate.

I have to say that this series has definitely been a fun one to do.  I hope that this gave you a good introduction into vCO and how you can apply it to your daily tasks.  So kick back, automate, and prepare to have more time to do other things than your daily tasks.  On an ending note, please go grab yourself a copy of Cody Bunch‘s book, Automating vSphere with VMware vCenter Orchestrator.  This is by far a great reference and how-to on real world use cases.  Anyway, have a fun time with Orchestrator and as always, if you have any questions then please sound off in the comments and I will see if I can help!

1 2 3 4 5 9  Scroll to top