VMware Cloud Community
gamename
Enthusiast
Enthusiast

Datastore Naming Conventions And PowerCLI

Hi,

We are trying to define a good naming convention for our datastores.  Anyone have experience with what does and does not work well within the PowerCLI scripting environment? 

Most conventions are not put together by programmers. There are common pitfalls that may be missed. For example, I tend to shy away from dashes ("-") in naming conventions for 2 reasons: 1) They can complicate parsing (i.e. regexes) and 2) They don't really convey any information, they're just separators.  If one has to have a separator, use underscores. They tend to induce fewer problems programmatically.

Thoughts?

-T

0 Kudos
1 Reply
LucD
Leadership
Leadership

A naming convention is of course very site dependent.

You use what works for your environment

There are some general guidelines I normally use, employ them for what they are worth :smileygrin:

  • Use valid characters (obvious, but so often overlooked)
  • Try to use names that can cope with changes in your environment. For example, don't include the name of the storage array in there, if that HW can be replaced next year.
  • Make sure your names allow easy filtering. For example, if you have a DR site, make sure that datastores in your DR site can be easily filtered out. Note that you could also do that with other properties of the datastore object.
  • Don't try to cram too much information in the datastore name. Just make sure that you have a naming scheme that produces unique names.
  • Document your naming scheme, and make sure everyone is following the scheme.
  • Test your naming scheme on paper. See if it can handle all possible situations.
  • Use common sense !

But like I said, this is very much site dependent.

Think about a naming scheme first, before starting to name your datastores


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference