vCloud Director Affinity Rules and the drsShellVM
Post
Cancel

vCloud Director Affinity Rules and the drsShellVM

In vCloud Director 8.10 for Service Providers, VMware introduced the ability to configure VM Affinity Rules via the vCloud API and vCloud Director portal.  This effectively allows users to setup their own DRS rules to either separate certain VMs onto different hosts on keeps certain VMs on the same host.  vCloud Director does the job of setting up the DRS rules in vCenter based on what the user configures in the portal.

In this example I’ve created an Anti-Affinity Rule to separate 3 Linux VMs.

Anti-Affinity Rule

I went to check on what had been done on the vCenter sides of things.  Sure enough, the DRS rules had been created but there had also been an extra VM created on each of the clusters assigned to my Provider VDC.  These VMs, both with the same name starting with “drsShellVM” were not powered on and have a really small specification; 1 vCPU, 4MB RAM and no disks.  They were also in the DRS rules that had been created.

DRS Shell VM 1

Given that they’re tiny, are never powered on and don’t consume any storage, they appear to be pretty harmless, but I had no idea what these were for so I asked our vCAN SE at VMware.  The answer actually made perfect sense…

So, if a Provider VDC has more than one vSphere Cluster assigned to it, then customer Virtual Datacentres can use resources from any of those cluster.  VMs created by the owner of that VDC could be placed on different clusters.  It’s not something the customer would know about, it would happen automatically.  This also has nothing to do with affinity/anti-affinity, it could just be that the service provider wants to limit cluster sizes, so uses multiple smaller clusters rather than one big one.  As far as the customer is concerned, he has a pool of resources and vCloud Director deals with where those VMs are placed.

DRS rules in vSphere are created on a per cluster basis, so if you have VMs on several clusters that are part of the same vCD Affinity Rule, vCD would actually have to create a new vSphere DRS rule in each cluster.  But what would happen if one of your VMs was on a cluster that contained no other VMs that were in the vCD Affinity Rule?  Well… you wouldn’t be able to create a DRS rule because you need a minimum of two VMs in a vSphere DRS rule.  So, the drsShellVM is put into every vSphere DRS rule that vCloud Director creates to ensure that situation never arises.  In my test scenario, Linux03 was the only VM in my “SiteA-Compute02” cluster so would otherwise have been in a vSphere DRS rule by itself which wouldn’t be allowed.  The addition of the drsShellVM means it still works.

DRS Shell VM 2

drsShellVM mystery solved 🙂

This post is licensed under CC BY 4.0 by the author.