Product Announcements

Virtual Spring Cleaning – Organization within vSphere

As I talk with more and more of our customers, it seems like there is an increasing number of IT/VMware admins that are experiencing “growing pains” in their environments. This does not come as a surprise if we consider the rates in which technology is exploding.

clip_image002

As a result of their growing pains, the questions are asked, “what can we do?”, “How can we keep our virtual environment organized?”, “How can we stay on top of the rate we need to be deploying virtual machines?” etc.

There are three different suggestions I would like to give to help keep your environment organized and decrease the amount of effort to keep it that way:

  • Naming Prefixes/standardization
  • Renaming existing virtual machines
  • Implementing the use of tags

Naming Prefixes

This may seem second nature to many of you, however, there are plenty of times that I see environments with virtual machines that have little to no naming standardization. Just like keeping your office clean, naming prefixes/standards require constant effort and the determination not to give in (even for that quick “test vm” or “temporary vm”). There should be careful consideration given to the naming convention so that there will be no need to go back and correct past virtual machine naming mistakes. Naming should be focused on the clarity of the purpose/role of the given object.

Naming conventions and prefixes should be considered for the following items:

  • Virtual Machines – Example (purpose_environment_##) (EXCH_PROD_01)
  • Datastores – Example (datacenter_environment_storagearray_##) (SLC_STAGE_VPLEX_02)
  • Networks – Example (name_typeoftraffic_VLAN) (FIN_PCI_730)
  • Clusters
  • Templates
  • Profiles & Policies

A virtual machine naming convention will be different than the  cluster, network, or datastore naming conventions, so do not try to apply the “one-size fits all” rule of thumb here. If it is applicable, use it. If it is not, there should be other naming conventions as needed.

Renaming VM’s to adhere to chosen naming convention –

Adopting a naming convention and implementing it will likely not occur overnight. However, as you begin to implement better naming conventions you will find how much easier it will make your life. If you already had a virtual environment prior to creating a naming standard, you will likely have to go back and rename your existing virtual machines. Simply right-clicking a virtual machine, clicking ‘Rename’ and changing the name will not give you the organized consistency that you strive for. Although this will change the name of the VM you see in vSphere, the folder and files in the datastore are still represented by the original name of the VM. Performing a storage vMotion will update the filenames on the datastore to reflect the new virtual machine name.

Renaming ‘ScriptingVM’ to ‘PS-ScriptingVM-01’

Screenshot 2014-06-05 13.22.46

There is now disparity between the virtual machine name and it’s associated folder and files on the datastore.

Screenshot 2014-06-05 13.22.52

Performing a Storage vMotion to another datastore will cause the associated files in the datastore to re-sync to the virtual machine’s new name.

Screenshot 2014-06-05 13.23.09

As you can see, our virtual machine and it’s corresponding folder (and files) are now matching again.

Screenshot 2014-06-05 13.44.31

Alan Renouf has a simple script that can be run which returns current mismatches between the VM name and the VM folder. The script can be found http://www.virtu-al.net/2009/06/22/powercli-folder-name-mismatch/

Tags

There have been several great posts in the last few months regarding tags. Tags allow for defining and categorizing objects within your environment. These tags essentially allow the user to attach metadata to items in the vSphere inventory. Categories can be created to organize the tags that are created. Tags can be used for many purposes. Some may use these to mark which Line of Business a VM belongs to, while others may use these to mark objects with special requirements, operating systems, notes, etc. Essentially the tags can be used in any way that you want to help simplify and organize objects in vCenter. Once tagged, objects can be searched for within the vSphere Web Client by the tag.

Tags are very easy to use. Once logged into the vSphere Web-Client, click the ‘Tags’ button in the left-pane.

Screenshot 2014-06-05 10.23.25

Create a category that will house tags. Give it a name, description, and decide which inventory objects will be able to be tagged.

Screenshot 2014-06-05 10.53.17

The category will now show up in the Tags > Category pane. We can now proceed to create our tags.

Screenshot 2014-06-05 10.53.24

Creating a tag is as simple as giving it a name, description (optional), and assigning it to a category.

Screenshot 2014-06-05 10.53.49

Now that we have our tag and category, we can start tagging relevant objects in vSphere. You can assign tags to objects by right-clicking them and selecting ‘Assign Tag’.

Screenshot 2014-06-05 10.55.29

Choose the corresponding tag and click ‘Assign’.

Screenshot 2014-06-05 10.55.35

Objects can then be filtered in the web-client by searching for the tag name

Screenshot 2014-06-05 10.56.24

Our virtual machine view is now filtered and we only see the three VMs that we tagged as ‘DR’.

Screenshot 2014-06-05 10.56.29

As with naming conventions and organizing the VM/Datastore names, careful consideration should be used to determine the tag category as well as the tag names associated with each category before proceeding in order to avoid having to redo any previous efforts in the future.

For those of you looking for a faster way to work with tags, take a look at the following post by Dimitar Barfonchovski from the PowerCLI team.

http://blogs.vmware.com/PowerCLI/2014/03/using-vsphere-tags-powercli.html