VMware Cloud Community
Nikko26
Contributor
Contributor

blueprint and prefix

Hi,

Does anyone knows if there is a way to use a blueprint without specifying a prefix name ?

I'd like to deploy some vm and take names from a pre-defined list (for example from a csv file).

Thanks for answers.

0 Kudos
8 Replies
ErikBussink
Enthusiast
Enthusiast

Yes (to not using Prefix in the Blueprints) and it's simple and elegant for our needs. Smiley Happy

We are using Global Blueprints where the Prefix is set to "use group default"

And in the Provisioning Groups we set the default machine prefix to "TEAMA" or "TEAMB" etc.... This works great to set the name of the virtual machies based on the teams (vORG-alike).

So if Team A deployes a W2K3 Blueprint or a W2K8 Blueprint, the machines will be named TEAMA0001, TEAMA0002, TEAMA0003 etc...

Team B which only deploys W2K8 wil have TEAMB0001, TEAMB0002

But this wil not cover your request for CSV imports.

Regards,

Erik

-- Erik Bussink 1st VMware Community account https://communities.vmware.com/people/Erik%20Bussink
0 Kudos
Nikko26
Contributor
Contributor

Ok,

But what if you do not want to use number after this prefix ?

Imagine when you want to create a virtual machine, an enterprise tool mandatory generates names for you (first letter for physical / virtual, two letters for location, another 3 letters for server role and finally 3 alphanumerical characters) : is there a way to tell vCAC that it must take names from another source (no matter if this is not a csv file) ?

Thanks

0 Kudos
admin
Immortal
Immortal

There are two ways to customize prefixes, but only one technically available out of the box.  The first is a name activity plug-in that you can configure to use an assembly that you install written in .NET which can do complex naming strategies, this isn't documented as part of the out of the box extensibility and is primarily used by professional services developers to create extensions.

The second, is the workflow designer which can be used to fire a workflow on a given set of states, in your case you probably want to invoke it on BuildingMachine and you could either write your custom code in workflow (which reading from CSV entirely in windows workflow could be tedious) or you could invoke a powershell script to get the name and update the machine record.  This is supported, but I haven't seen any great samples and it would take a few test passes to get it working right.  I have a few examples that are close (attached), but not exactly this use case...

With the sample, you'll probably have to some fiddling around to get it wired up.  I'd open the workflow file in designer and copy the powershell activity to the existing BuildingMachine stub workflow since you cannot upload xaml from file at this time using the designer.  Though before you jump in, you might want to look at the published extensibility guide to understand how this works.

In either case, you'd need to be sure to use some locking on your file or database if you intend to support requesting multiple machines at once since you would not want duplicates (vcac wouldn't be aware that you using some volatile resource).  If using CSV, you'd probably want to read-lock the file or something and make sure to close/dispose the reader.

0 Kudos
Nikko26
Contributor
Contributor

Many thanks for your answer !

I'm going to take a closer look to your workflows and will give you a feedback.

0 Kudos
ShibbyB
Enthusiast
Enthusiast

A workaround could also be use the custom property hostname and select prompt user for the value, doesn't work with requesting multiple machines.

0 Kudos
keeleral
Enthusiast
Enthusiast

This thread is a bit old so im hoping there has been movement on this.  I have a similar request, i do not want to use the machine prefix option.  I have an enterprise cmdb where our names and ip address are stored and auto generated.  we have the process built to kick off from a landing page but i need to understand how to invoke it from vCAC.  I have not found a way not use the prefix, is there a way to override it?  Has anyone built a workflow that calls an enterprise cmdb and added the name it returns to the provisioned vm?

Thanks

0 Kudos
vmmeup
Expert
Expert

This is poswsible, but not with the Designer itself.  You need to leverage a custom workflow that is ecextuted before the "BuildingMachine" state to effectively be able to change the hostname.  The goal is to modify the custom property that hold the machine name.  You woul dstill need a machine prefix and initially the machien would get it's name from the prefeix.  Once the request is submitted your custom workflow would go out, retrieve the name from your CMDB and then update the custom property for the name overriding the name assigned by the prefix.

Give me a few days and I will put together a clog post on this scenario.

Thanks,

Sid Smith

http://www.dailyhypervisor.com

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
dskurtzjr
Contributor
Contributor

Checking to see if anyone has made progress on this topic.

I'm working on building vCAC to a point where the Blueprints are very generic and all the customizations are user driven, however overriding the default machine prefix in the Blueprint is the one area that's causing me some problems. Ideally I'd like to have a drop down list of machine prefixes the user user can choose from. I could build a custom hostname based on pre-selected choices, but if I did this I don't know that I'd be able to leverage the machine prefix auto increments.

0 Kudos