vCloud Automation Center – vCAC 5.2/6.0 – Custom Hostnaming Extension v3.1

Overview

One of the most frequent asks when using vCAC is, “How do I deploy machines using my company’s hostnaming standards automatically using vCAC?”  Since the out-of-the box hostnaming only provides a way to do prefix-suffix, the answer to this question usually is that it will require customization.

This solution is intended to provide a way to implement this functionality by using a small, highly versatile custom extension which can handle 95% of use cases without writing custom code.

The rest of this article contains instructions on installing and configuring the vCAC Custom Hostnaming Extension.  This extension allows administrators to model very specific custom hostnaming schemes for their vCAC virtual machines, multi-machine services, and vCloud Director vApps using vCAC custom properties, with dynamic creation of stock machine prefixes and index tracking for each unique hostname combination.

This extension is proof-of-concept or demo grade.  While it runs well and consistently, it has not been put through a formal quality assurance process, so please use with caution.  Please see the disclaimer and other information in the readme.txt file in the package.

 

Changelog

v4.0

For v4.0, which is compatible with vRA 7, go to the following link:
http://dailyhypervisor.com/vrealize-automation-custom-hostnaming-extension/

v3.1

  • Resolved reprovisioning issue so that the machine will no longer be renamed
  • Fixed compatibility with VirtualMachine.Admin.NameCompletion property
  • Simplified installation and configuration
  • Refactored the workflows for much more modular design

v3.0

  • Ported to vCenter Orchestrator
  • Added check for existing VM with same name (if exists, will increment)
  • Added ability to leave out the index number for the first instance of a name
  • Solved concurrency issues which caused duplicate names when requesting more than one of the same blueprint

v2.0

  • Added support for vCloud Director vApps
  • Added dynamic Machine Prefix creation and tracking for every unique combination (this affects configuration, so please read if you’re coming from version 1.0)

v1.0

  • Initial release

 

Download

vCAC Custom Hostnaming Extension 3.1

 

Installation

These installation instructions assume the following:

  • You have a working vCenter Orchestrator in your environment.
  • You have a working knowledge of administering vCO.
  • The vCloud Automation Center 5.2 or 6.0 plugin for vCO has been installed, and a vCAC host has been added.
  • You have the vCenter Orchestrator instance configured as an endpoint in vCAC.
  • vCAC 5.2 or 6.0 is preconfigured with at least one working Blueprint.  Two individual Blueprints and a Multi-Machine Service Blueprint are better in order to see the full functionality.

Follow the steps below to perform the installation:

  1. Download com.dailyhypervisor.vcac.customhostname.package from the link above and copy it onto the local filesystem of the system where you will run the vCenter Orchestrator client.
  2. Import com.dailyhypervisor.vcac.customhostname.package into your vCO instance.
  3. Run the workflow Daily Hypervisor > vCAC > Custom Hostname > Install custom hostname extension.
  4. Choose the vCAC host where you’d like to install the extension and click Submit.
  5. Follow the instructions described by the workflow to download and install the external workflow XML file into vCAC.

 

Configuration

To configure vCAC to use the custom hostnaming extension, perform the following steps:

  1. Go to Enterprise Administrator > Build Profiles.
  2. Click on New Build Profile.
  3. On the New Build Profile page, click the drop down for “Add from property set”, and choose our new custom hostname property set.  Click Load.
  4. You will now have all of the custom hostnaming extension properties in your Build Profile.  Below is an explanation of each property.
     
    Custom.Common.SetCustomHostname.Execute
    The existence of this property triggers the custom hostnaming workflow to run.  This must be specified to leverage the extension’s functionality.
    Note:  The value is set to “true” by default, but this is just aesthetic.  Setting it to “false” will not stop the workflow from running.  This property only needs to exist to trigger the workflow, regardless of its value.

    Custom.Common.ComponentMachine.HostnameString
    This property’s value represents the hostnaming scheme you are using for a component or single machine.  The format of this string looks something like this:  {part1}-{part2}-{##}-vm.  The parts enclosed in curly brackets represent the name of a custom property whose value you’d like to plug in to that slot.  The ## indicates that you would like a two digit auto-incrementing index placed in that slot.  Anything not in curly brackets is placed in the hostname as-is.

    Custom.Common.AppService.HostnameString
    This property is identical to the one above, except that this scheme gets applied to a multi-machine service or vCloud Director vApp instead of a component or single machine.

    Custom.Common.ComponentMachine.NoIndexOnFirst
    Adding this property and setting the value to “true” causes the workflow not to add the index to the hostname on the first instance of each unique name.

    Custom.Common.AppService.NoIndexOnFirst
    This property is identical to the one above, except that it applies to a multi-machine service or vCloud Director vApp instead of a component or single machine.

    Custom.Common.Hostname.OwnerShortNameIdentifier
    If this property is specified, it indicates to the custom hostnaming workflow that this value is the identifier of the part of the hostname string where the short username (no domain and backslash) of the owner should be placed.  For instance, if you specified this property with a value of USR, any part of the hostname string where {USR} is specified will be replaced with the owner’s short username.

  5. Let’s configure an example custom hostname scheme to get a working understanding of the functionality.  We will build a single machine hostname scheme.  The next step is to refine the property set in our build profile.Since we are configuring for a single machine, delete the Custom.Common.AppService.HostnameString and Custom.Common.AppService.NoIndexOnFirst properties altogether.
  6. Also, let’s exclude the owner short username and index removal functionality for this example, so delete Custom.Common.Hostname.OwnerShortNameIdentifier and Custom.Common.ComponentMachine.NoIndexOnFirst.
  7. Edit the Custom.Common.ComponentMachine.HostnameString property value to model the following use case:
    • This scheme has four parts:  a location identifier, a group identifier, an application identifier, and an auto-incrementing index, respectively.
    • Use LOC for location, GRP for group, and APP for application.

    Your hostname string should look like this:  {LOC}{GRP}{APP}{###}.  Name your Build Profile.  You will end up with a new Build Profile as shown below.

  8. Now we need to configure the custom properties for each variable identifier in the string.  Location ties most closely to the Compute Resource or Reservation, so let’s take advantage of the custom property hierarchy and specify it there.

    I set LOC (our location identifier) to JAX to represent Jacksonville.

  9. Group will be specified at the provisioning group level, so in my Development Provisioning Group, I created a property named GRP with the value DEV.
  10. The APP identifier’s value will be unique to the Blueprint.  So I went to my Apache Web Server Blueprint, created a property named APP, with a value of LAMP.  Also, be sure to select the Build Profile we created in order to tie the hostname string and workflow trigger property to builds from this Blueprint.

By putting three # symbols in for the index, we are indicating that is will be three digits. Since it will be the first time using this hostname combination, the extension should dynamically create a new Machine Prefix, and the index should start at 001 and increment from there.

So, if I request an Apache Web Server on the Jacksonville Compute Resource, as a member of the Development group, my end result should be…

JAXDEVLAMP001

A test reveals that the custom hostnaming extension does its job.

Custom Multi-Machine Service and vCloud Director vApp Naming

Custom multi-machine service and vApp naming works in an almost identical way.  However, there are two differences to note.

  1. It uses a different hostname string property.  Instead of Custom.Common.ComponentMachine.HostnameString as in our previous example, the workflow looks for Custom.Common.AppService.HostnameString.  The reason for this is to allow component machines to have different naming schemes than their parent.  Component machines inherit properties from the parent multi-machine service or vApp, and when the same property is specified on both levels, the parent property overrides that of the component machine.  Therefore, without separate properties, component machines would be forced to implement the same hostnaming scheme as the parent multi-machine service or vApp.
  2. Multi-machine services do not inherit all of the same properties as component machines.  Namely, they do not inherit properties from placement entities, such as Compute Resources and Reservations.  This is because multi-machine services themselves do not reside anywhere or consume resources.  They are simply a logical grouping of actual machines.  The component machines are the ones that are actually placed on infrastructure, and it’s possible to configure a multi-machine service with component machines that can or will end up on different resources, even in different locations.  So it becomes impossible to logically tie multi-machine services to singular infrastructure. vApps, on the other hand, do support locations, as vCloud Director and vCAC both consider them as located in the organization vDC, along with their component virtual machines.In other words, if you were to use the value of Custom.Common.ComponentMachine.HostnameString in our previous example as the value of Custom.Common.AppService.HostnameString in a multi-machine service, you would get an error, because it will not find a property named LOC.

 

Adding the Owner’s Short Username to a Custom Hostnaming Scheme

One additional function you can use that we did not explore in our example is adding an owner’s short username (without the domain and backslash) as a part of the hostname.

To do this, you can simply specify one additional property, Custom.Common.Hostname.OwnerShortNameIdentifier.  Set the value of this property to the identifier you will use in your hostname string to specify where to place the username.

Here’s an example Build Profile created for this scenario:

If I logged in as CORP\Administrator and requested a machine from a Blueprint with this scheme enabled, and assuming that I have already provisioned 27 instances, leaving the next index as 28, I could expect the machine to be named like this:

118 Replies to “vCloud Automation Center – vCAC 5.2/6.0 – Custom Hostnaming Extension v3.1”

  1. I am getting an error on the first command:

    Could not load file or assembly ‘file:///C:UsersXXXYYYYvCACCustomHostnamingExtensionVMware.vCAC.Custom.Common.Activities.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
    Warning: Non-zero return code. Command failed.

    Any clue what is going on here? Thanks.

    1. Check the downloaded package and/or its contents. Sometimes when you download a package from the internet or copy it that contains DLLs or EXEs, you have to go into the properties of the package or the content files and “Unblock” them.

  2. Hi Tom,

    Have you had success using this procedure on vCloud director vApps?, I want to configure a multi-machine on vCAC that gets its name (vApp container) based on the user requesting it, but follow a conventional machine prefix for the components. Following the article I created a build profile using these properties:
    Custom.Common.AppService.HostnameString {USR}{#}
    Custom.Common.Hostname.OwnerShortNameIdentifier USR
    Custom.Common.SetCustomHostname.Execute true

    Then I add the build profile only to the container blueprint, and change the prefix to a custom one as described in the article. After deploying the blueprint, the component VM gets the correct name but the container is named to “custom100” instead of getting the username.

    Any help is appreciated.

    Thanks,

    Juan.

      1. Some extra information from the Log Viewer:

        Error 9/18/2013 12:48 PM Repository Repository vcac-web Resource not found for the segment ‘WorkflowOperations’.
        Error 9/18/2013 11:44 AM DEM-Worker DEM Worker 1 vcac-server Workflow “SetCustomHostname” failed with the following exception: Object reference not set to an instance of an object.
        Error 9/18/2013 11:44 AM DEM-Worker DEM Worker 1 vcac-server Workflow “SetCustomHostname” failed with the following exception: Object reference not set to an instance of an object.

    1. Juan,

      I didn’t initially create this to be compatible with vCD vApps. I’m going to apply a fix and repost with vCD vApp support sometime today. Thanks for bringing this to my attention.

  3. Blog post has been updated!

    v2.0
    -Added support for vCloud Director vApps
    -Added dynamic Machine Prefix creation and tracking for every unique combination (this affects configuration, so please read if you’re coming from version 1.0)

  4. Thanks for taking the time to add vCloud director support. I guess the naming customization applies only to components, so in the case of vCloud director my vApp names can only be set to whatever I define in the machine prefixes, which is kind of limited, am I correct?

    1. Sorry for the late reply. No, this works for both the vApp itself and the components. Different properties control each, as explained in the guide.

  5. Hi Tom, why don’t you use a custom script in the BuildingMachine workflow step? With that you would not need a CDK license. And according to vcacteam.info you would still be in the more support “extensibility” area (instead of “customisation”). Regards, Ronald

  6. Hi Tom,

    I’m working on a similar solution to fit my companies naming convention and came across this post! – great work! I am awaiting the arrival of our CDK licence key to begin coding, but I’m interested in how you generate the unique number using this solution? Would you mind sharing how you achieved this??

    1. Hi Ross,

      Do you have vCenter Orchestrator available in your environment? I’m finishing up a ported version for vCO which does not require CDK, and all of the magic in the workflow schema and scriptable tasks is wide open to view and/or edit to your liking. I’m aiming to publish it by the end of the week.

      1. Hey Tom,

        I do have orchestrator available in my enviroment. I’m looking forward to seeing the updated vCO workflow version of this, although I have just purchased the CDK – I’m sure that I’ll still need to call custom stubs, even if they only contain a calll-out to a vCO workflow. We have multiple, layered standards that I think I’ll only be able to satisfy if I can control exactly which blueprints they run on!

        Let me know once its posted 🙂

      2. Hey Tom,

        Thanks again for this creating this great plugin! I’ve been playing around with it and I have hit a problem that I hope you have seem (and resolved in the past)!

        If I request multiple VMs, or request VMs in quick succession that would use the same naming convention the sequence number does not get iterated quick enough and all requests get issued the same name… Have you seen this before? If so how did you resolve it? I’m working on a vCO workflow to check the execution status of another workflow and wait for a random time period if anything else is running but its not a foolproof method – as the workflow token takes a fraction of a second to create and may not be there at the time of my test…

    1. If you are not seeing the name you expected something is not working properly. The machine prefix should only be utilized to increment the unique prefix from. It would not be overriding, it in fact is not being overridden itself by the workflow.

    2. I am having the same problem on vCAC 6.0. You have to define a Build Prefix what should it be set to? All my machines are coming out customXXX.

      1. The dynamic machine prefixes the workflow creates should not be used for the default out-of-the-box prefix. I recommend choosing something generic or descriptive, such as unnamedXXX or somerthing like that for all Blueprints and/or Provisioning Groups. Then the workflow should change it based on the hostname string property you specified. If it doesn’t work, I recommend checking to make sure the External-SetCustomHostname.xml file has been installed properly on the manager server, and that you’ve restarted the vCloud Automation Center Service.

  7. v3.0 is up!

    – Ported to vCenter Orchestrator
    – Added check for existing VM with same name (if exists, will increment)
    – Added ability to leave out the index number for the first instance of a name

    1. Hi,
      On vCAC 6.2, when there is already a machine on vCenter, does not increase and the request fails. I’m using v3.1.

      Can you help me?

  8. Tom,
    Let’s say I want create my own system name on the fly what’s the best way to pass it from vCO to vCAC when provisioning a new system against a blueprint. To be clearer I would want the same behavior as if you prompted the user to enter a hostname in the traditional vCAC UI.

    1. Mr. Remy,

      How’s it going man? Good to see you on here.

      Actually, you could just leverage this package, and, in the BuildingMachine stub, BEFORE this workflow runs, set a custom property of your choice which will represent the hostname. Then set your Custom.Common.ComponentMachine.HostnameString property to {YourCustomPropertyName}. That should do it.

  9. vCO 5.5 embedded w/ vCAC 6.0. Trying to edit the vCAC Environment element is reporting a “missing element” so I can’t select the vCAC host. I assume that this is because the package would only partially import, due to the server having newer versions of the elements under the Library vCloud Automation Center.

    Thoughts on how to fix?

    1. I too am trying to run the custom hostname extension using the built-in vCO in vCAC 6.0.0
      Same problem where several items within the package are not flagged for import . . . server version newer.
      So I imported what I could and then ran the Daily Hypervisor > vCAC > Custom Hostname > Install custom hostname extension,
      and it fails with no messages at all.

      1. … the vCAC Host has been successfully added. First WF prompt in “Install custom hostname extension” asks for the vCAC host, which I am able to apply successuly. It fails thereafter on Submit.

  10. Hi Tom,
    thanks for the workflow, supporting the customers Naming Convention is always a good thing. Now I’ve 2 issues even that I followed exactly (and without errors) your installation and configuration guide. First: the workflow is simply not triggered and Second: The “LOC” Custom Property is not provided/inherited from the Resource Part, strange (the two others work fine). Any idea?

    Thanks a lot,
    Sascha

    1. I recommend checking to make sure the External-SetCustomHostname.xml file has been installed properly on the manager server, and that you’ve restarted the vCloud Automation Center Service.

      The only way “LOC” would not be inherited is for one of two reasons:
      1. It is a multi-machine service name so the location does not apply.
      2. The machine is landing on a resource that is not tagged with the property.

  11. First of all, thanks for your efforts in keeping development on this going. Secondly, is this confirmed working in the GA 6.0 version of vCAC because I cannot seem to get it to use custom over default prefixing. I am using the integrated vCO and installed the downloaded template from the workflow to the IAAS host. The install goes through without incident, but the custom naming never takes effect. Services and hosts have been restarted.
    Thanks again for all the work…

    1. You can remove it in the DB, but there’s really no need. It doesn’t take up much space. I might add uninstall into a newer version, but, for now, simply deleting the trigger property from each Blueprint and/or Build Profile will stop it from running.

  12. v3.1 is released!

    – Resolved reprovisioning issue so that the machine will no longer be renamed
    – Fixed compatibility with VirtualMachine.Admin.NameCompletion property
    – Simplified installation and configuration
    – Refactored the workflows for much more modular design

    1. Hey Tom,

      I’m running into an issue with the current version of your workflow – I have found the issue but have not yet found a way to resolve it. In the formulate hostname script you initialize a for loop using hostnameStringProp.length to define the loops condition. This string function does not seem to be present in my vCO appliance(s). From some debugging output I have added when you run that function the returned value is ;

      [2014-03-05 10:11:54.930] [D] DEBUG: hostnameStringProp.length = function length() {/*
      int length()
      */}

      Which results in the loop not being processed and necessary variables not being populated;

      [2014-03-05 10:11:54.930] [D] DEBUG: newNameString = ”
      [2014-03-05 10:11:54.930] [D] DEBUG: shortOwnerName = ‘undefined’
      [2014-03-05 10:11:54.930] [D] DEBUG: ownerName = ‘undefined’
      [2014-03-05 10:11:54.930] [D] DEBUG: ownerEntity = ‘undefined’
      [2014-03-05 10:11:54.930] [D] DEBUG: indexPlaceholder = ”
      [2014-03-05 10:11:54.930] [D] DEBUG: indexLength = ‘0’
      [2014-03-05 10:11:55.191] [I] Hostname is already in use, and there is no index to increment (Workflow:Set custom hostname / Formulate hostname (item4)#184)

      Any suggestions?

      1. Tom,

        I found out the issue , but I don’t know why it happens… for some reason the hostnameStringProp input parameter was not being evaluated as a string. I added the following line of code to force it to be seen as a sting and all works just fine now!

        var hostnameStringProp = “”+hostnameStringProp+””
        for (var i = 0; i < hostnameStringProp.length; i++)

        Let me know if there is anything else that you think could have caused this (or a better workaround if you find one!)

        Ross

        1. Okay, this problem is not just happening to you. It’s the second time I’ve seen it and haven’t been able to get to the bottom of it so far. I’m going to look into it some more. What makes it difficult is that I’m not seeing the same problem in either of my two environments for some reason.

          1. Okay, so for anyone else having this problem, it is due to a bug in vCO/Javascript having to do with string concatenation. This bug has been fixed, so updating vCO to the latest maintenance release should do the trick.

  13. Hi Tom,
    Great work on this extension. I’m having a bit of a problem getting it to work in vCAC 6.0.1 with the vCO 5.5.1 appliance. The VMs are coming out with the machine prefix instead of using {LOC}{GRP}{APP}{###}. I noticed in previous comments that you asked people to check for the External-SetCustomHostname.xml file. I looked on the IaaS server and could not find it anywhere. Can you tell me where this file comes from and where it should be on the IaaS server?

    Thanks,
    Sam

    1. The vCO installer workflow generates it. You have to download and install it when it comes up. It tells you exactly what to do on-screen. If you missed it, simply re-run the installer and try again.

  14. I’ve just installed vCAC 6.0.1.1 and I can’t get the extension installation workflow to run. It looks like the vCAC host object type name has changed in the latest vCAC plugin for vCO? Has anyone else seen this, or am I missing something?

    1. A new type of vCAC host has been added for connecting to the catalog appliance, but this doesn’t affect the workflow. It should work fine on 6.0.1.1. Have you checked to make sure the ExternalWF XML file was properly installed?

  15. Hello there! I’m having some trouble putting the extension to work on vCAC Build 6.0-1720522. Is there a new version coming out anytime soon? Thanks for the good work!

  16. How do i imprt the xml file generate by the install workflow. I ran the workflow it complete and created the xml what do i do with it. The comment section of the page are not rendering correctly in any of my browsers.

    1. Sorry about that. The comments have now been fixed. The installer gives you exact directions on the same screen where you download the file. If you missed it, re-run the installer and try again.

  17. Hello Tom, great work you’ve got here.
    For some reason, I’ve been facing an error saying “org.mozilla.javascript.NativeString cannot be cast to java.lang.String” on item5 (Update virtual machine entity) of the “set custom hostname” workflow. Any thoughts? I’m running vCAC 6.1 and VCO 5.5.2.

    Besides that, i’m not finding the call to the workflow in the BuildMachineStub, could you give some directions?

    Thanks!!

      1. Getting the same “org.mozilla.javascript.NativeString cannot be cast to java.lang.String” error in a new environment.

        vRA 6.2 Build 2330392
        vRO 6.0.2.1 Build 2707386

        There doesn’t seem to be any updates available for either.

  18. Hi Tom, I have VCAC 6.1.0 build 2077124 and VCO 5.5.1. I imported the package into VCO, when I run it get the error:
    ‘can’t read property id from null’. Also it doesn’t ask me for hostname when I run the ‘install custom hostname extension’

  19. Hey, great work there. Been looking a lot for something like this. 🙂
    Just one thing I´d like to ask is about the use of hostname string.
    Above you said that “Anything not in curly brackets is placed in the hostname as-is.”

    So is correct to assume if I set Custom.Common.ComponentMachine.HostnameString to something like

    machine1{##}windows

    I´d end up with a machine named

    machine101windows

    Is my reasoning correct?

    Once again, very nice work with this extension.

  20. How can i change the startnumber (for example 0001 to 1000)? I can’t change the prefix configuration in the gui because you create a name with “{” and “#”. This is not supported in the gui so i can’t click save.

    1. if you go to hostname prefixes under blueprints menu you will see a prefix used for your name combination. You can change it there.

  21. I had to change vco servers but I need to remove extension since just running the install on the new vco doesnt update it.. when I run any blueprint It still runs hostname workflow from the old vco server. What’s the syntax to delete in the DB?

  22. Okay, I know I should have a dev environment for this but I don’t yet. So, Tom is there a way to install this twice on one vCO server and set a custom property to use one for one blueprint and a separate one for another blueprint?

    The reason I ask is I need to incorporate some kind of DNS check so that vRA can create a new machine prefix while knowing about non-vRA items also. So, I want to play around with that while not interrupting users but I don’t have a Dev environment.

    Thanks for the work on this. It works great.

    1. You surely can. the following are the steps you need to take:

      1. Duplicate the workflow(s) that are part of the extension and save them to different names. I would create a whole new folder structure mirroring the original all under new names.
      2. Modify the attribute values for the new version of the installer to reflect the new workflow names. You will also want to change other values to make sure they are unique from the original. Go through each of them and make sure you don’t have anything overlapping with the original. You don’t want them to cross paths.
      3. Run the installer to install the new version.

      I know this is high level if you need more detail let us know.

  23. Running vCO 6.0.1 with vRealize Automation 6.2.1, I have the vCloud Automation Center plugin 6.1.0 installed, and when I run the workflow: Daily HypervisorvCACCustom HostnameInstlal custom hostname extention. It is looking at vCAC Infrastruture Administration instead of vCloud Automation Center.

    1. I haven’t tested with those versions, but it should be pointing to the IaaS host. It uses the IaaS API and plugin in vCO. Is the install working?

      1. So I have the package installed itself. I have ran the vCloud Automation Center > Configuration > Add a vCAC host. When I go to Daily Hypervisor > vCAC > Custom Hostname > Install custom hostname extension and run this workflow, it pops up with The vCloud Automation Center host instance. I click on Not set, and the select vCAC:VCACHost window has vCAC Infrastruture Administration, when I expand this nothing is there. When I click on Inventory in vCO I notice there is 2 items… vCAC Infrastructure Administration and vCloud Automation Center. Nothing is under the vCAC Infrastructure Administration Inventory.

  24. Just got this working on an environment with vCAC 6.2.1, vCO 5.5.1 and I have to admit I’ve been looking at the 3 to 4 different vCAC custom hostname options and none really accommodate a unique string like this. VMware really should bake this capability into vRA 7.0

    Thanks a lot guys for making this available. Saved a lot of headache over the clumsy Powershell options.

  25. how i can Create a custom property for setting up the machine name format data center + server function + OS[sequence number] from vra 6.2.1 ?i want to automate this thing .how it is possible ??

  26. Hi Tom,

    Thanks so much for this great how-to. How can I configure it in a way that Custom.Common.ComponentMachine.HostnameString value would be “st-poc{foo}” and ofcourse “st-poc” would be static but i would like to prompt the user for {foo} part, up to 5 characters. would this be possible?

    Thanks,
    Esi

    1. YEs it is possible. Youc an do it one of two ways. You can simply tick the checkbox when creating the property that says “Prompt User” Of you can use the property dictionary to format it a more user friendly way. If you need help with property dictionary see this articl on using drop downs. It’s one of many things you can do with the property dictionary. http://dailyhypervisor.com/vcloud-automation-center-vcac-5-1-creating-custom-drop-down-menus/

      1. Thanks for the quick response 🙂 here is what i did.

        Custom.Common.ComponentMachine.HostnameString value is set to “st-poc{Hostname}”
        Then i created a custom property on the blueprint called “Hostname” and value is empty and set to prompt user.

        When the workwflow runs, the log say “property part {Hostname} is not specified as a property on the virtual machine” and the machine gets created as st-pocundefined

      2. Ah nevermind. I think “Hostname” is already a reserved property so it did not work. When i tried a different name, it worked! thanks so much for your help! it is a great post!! 🙂

  27. Tom,

    Would it be possible to modify your package so that the naming conversion could incorporate the third and forth octets of the virtual machine ip address. And if so, what would be the best place to start.

    Format:

    Example:
    VM IP Address: 172.16.21.25
    VM Site Code: TNLS

    VM NAME: TNLS21025

    Thanks,
    Jeff

    1. Jeff,

      It comes down a chicken or the egg type thing can we get the IP address early enough to use it? If so then what could be done is use the hostname workflow the way it is designed. Create a naming convention that might be something like {Site}{OCT3}OCT4}. Prior to the custom hostname workflow running have another workflow run that takes the IP address and break the octets apart and then assign the third octet to the property OCT3, and the fourth to OCT4. No need to modify the custom hostname workflow at all.

  28. Hello!
    Some times i get the following error:
    ——-
    Snapshot isolation transaction aborted due to update conflict. You cannot use snapshot isolation to access table ‘dbo.VirtualMachine’ directly or indirectly in database ‘vCAC’ to update, delete, or insert the row that has been modified or deleted by another transaction. Retry the transaction or change the isolation level for the update/delete statement.
    ——-
    And “Update virtual machine Name” workflow filed. I use vRO 6.0.1 and vRAC 6.2.1

  29. Hi

    I have got this on vrealize 6.2.1 and vRO 6, ive run the “Install custom hostname extension.” workflow and all went well. When i try to use the custom hostname extension I get the below error..

    “vCenter Orchestrator workflow Set custom hostname failed with error: You must have at least one properly configured vCenter Orchestrator endpoint that is reachable..”

    I have VCO fully configured and can already run a CDROM mounting workflow through VCO fine.

    Any ideas?

    Thanks

    1. Same problem here : I’ve been using vRA 6.2.2 and got the following message in my log:
      “Workflow ‘SetCustomHostname’ has failed unexpectedly.

      Workflow ‘SetCustomHostname’ failed with the following exception: You must have at least one properly configured vCenter Orchestrator endpoint that is reachable.”

      Everything else is working fine in my vRA.

        1. Hi Sid,
          I’ve been using the default (embedded) Orchestrator Server, not an external one. And vRA is successfully connected to this Orchestrator Server.

  30. Thank you so much for this!

    Just got vRA installed and this made using our internal naming standard a breeze.

  31. I am getting error below error

    2015-06-16 15:29:37.324] [I] Property part {###} is not specified as a property on the virtual machine

    where to set number part using vra 6.2

  32. Hi Tom & Team,

    First of all, Bravo for making this, if it weren’t for people like you then vRO would not be the powerhouse it is today. The VMware community is STRONG!

    Regarding this customization, I use it a lot and its great. Only question I have is: When deploying this as part of a VM server provisioning that uses the common vRA->ASD Blueprint->vRO-vRA approach, I sometimes see a situation where the rename doesn’t happen fast enough or before the first lifecycle stub for “Building Machine” happens the rename doesn’t take.

    It appears this package uses something like the vCAC Designer to use a “system” stub flow that happens immediately after submitting the request but also before the first lifecycle stub. This works like 95% of the time but sometimes it seems that first stub kicks off before the custom hostname completes, hence locking in the temporary machine prefix.

    I believe this is a timing issue? If it is, can someone suggest where to put a sleep timer? I know using a time in the “Machine Building” stub doesn’t work, it would have to be somewhere else? Maybe in the “Set custom hostname” flow? Or maybe it is not a timing issue. Any ideas appreciated.

    Thanks
    Jase

  33. Hi DailyHypervisor / Tom / Sid

    Is it possible to use something like {ParentMultiMachineName} (as used in the Custom vCenter Folder Extension)?

    I am deploying multi-machine blueprints, which of cause contains multiple “single machine components”.
    I would like my “single machine components” to be named something like:

    MultiMachineName-SingleMachineName

    But I can’t figure out how this can be done, with the current extension.

    I have recently downloaded the Extension from this website (within the last month), so I assume that I am running 3.1 of the extension.

    vRealize Orchestrator is version 6.0.2
    vRealize Automation is version 6.2.1-2543390

    1. This can be done with some minor tweaking of the UltimateMM Blueprint extension. Have you figured out a solution to this?

      1. I ended up doing it in vRO “by hand”.
        I did a WFStubBuildingMachine workflow, that “filters” the multi-machine part from the single-machine parts.
        Used one of your workflows as the building block.

        On the Multi-machine part, I find all the actual Child Entities, and from that list I loop through those to rename the individual Child Entities. Once done I sent a Custom Event with the “UUID” of the Child Entity.

        On Single-Machine parts, I just do a Wait for Custom Event, with the UUID of the Single-Machine as the string.

        Made it work, although I have to do a “fix” for the customer in the coming weeks, regarding “Add components” functionality, because the customer is seeing a name-issue in that case.

        1. I believe the issue you were having is a race condition, the hostname was executing before the ultimate-multimachine. If you set the priority=2 in the xmldb file it would resolve the issue.

    1. Hi Tom,
      Thanks for providing great information
      In the package or any where in the attachment , I didn’t find any dll . Is the dll required to make the custom hostnaming work and if yes where do I need to place that dll. I am getting error when I use the customhostnaming for 6.2.2. The request returned back to vRA is a failed one.

  34. Everything works great but I do have a quick question. Is there a way to force whatever text that is entered to be converted to uppercase? I can’t seem to wrap my head around the code to figure it out. Any help is appreciated. Thanks again for all your hard work!

    1. There is a way. You will need to take the variable that holds the final name and do something like $hostname.toUpperCase() and it will make it uppercase. If you can’t figure it out I let me know and when I have time I will crack it open and see where you should put it.

      -Sid

  35. Anyone else having an issue with the incremental number not being supplied to the VM? I am getting an error of: “Property part {##} is not specified as a property on the virtual machine” in the vRO work flow log and an error of “Resource not found for the segment ‘VirtualMachines’.” in the log viewer of vRa. Everything else seems to be working fine.

  36. Hi,

    Help me !!

    I’m using vCAC 6.2.3 and built-in Orchestrator. I created Orchestrator endpoint and verified that was successfully working.I checked it under Administration > Orchestration configuration > endpoint > Test connection. I checked all vRO services are working. I ran workflow for “add the IaaS Host of a vCAC Host”. I downloaded and import “com.dailyhypervisor.vcac.customhostname.package” and I applied all settings you specified here. When I submit blueprint, hostname change policy is not working. Machine is being created with default machine prefix. What is wrong !

  37. Great job on this!!!

    Not sure if this will work for vRO/vRA 7.0?

    Trying to get this to run in vRA 7.0 and vRO 7.0 presents challenges right away.

    From VMware’s documentation:

    “Some create, read, update, and delete operations are restricted beginning with version 7.0. If you used the
    operations in your workflows in previous versions, they will not work with 7.0 and later. You can update
    your workflows to the supported operations or you can re-enable the operations that you need.
    To re-enable the operations, you must remove the operations that you want to enable from the
    operations.properties file.”

    http://pubs.vmware.com/vra-70/topic/com.vmware.ICbase/PDF/using-vra-plugin-70-guide.pdf

    Finally got the installation workflow to run and generate the XML. But now since VMware did away with Build Profiles in lieu of Property Groups, still working on adding the custom Properties from “Add from property set”… Anyone try this in 7.0 yet?

    1. Just an update.

      Once you re-enable the operations you need; specifically the “operation.read=ManagementModelEntities.svc@PropertySetXml” and “operation.update=ManagementModelEntities.svc@PropertySetXml”, you just need to manually add the custom properties for what you need to the Property Group, as the “add from property set” drop down is no longer available OOTB.

  38. Running into a random issue on vRA 6.2.2. When renaming a machine every once in a while (may 1 in 10) VMs doesn’t get renamed and keeps it’s initial temporary name. What’s odd is that you can see that the custom property “hostname” has been changed to the correct name. I even kicked off a blueprint with a quantity of 6 and 5 of the 6 worked fine but 1 didn’t.

    Has anyone seen this or have an idea how I can go about troubleshooting it? Thanks!!

    1. Steve, I’m running into the exact same issue on 6.2.2. I can’t for the life of me find a log file in the vRA stack that contains information about a mis-fire of the extension. In vCAC 5.2 it used to show up in the embedded log page.

      1. The issue was resolved by upgrading the plugin from 6.2.2 to 6.2.3 (despite it being a 6.2.2 environment). I never was able to find an error log or message. The only reason I tried 6.2.3 was because there was another issue we ran into that was fixed in 6.2.3.

Leave a Reply