HA

...now browsing by category

 

Distributed virtual switch and the .dvsData folder

poniedziałek, Październik 8th, 2012

If you use a distributed virtual switch you can notice that on some of your datastores there is a folder called .dvsData. Why is it created and what it is used for? Here you will find a description of this folder’s role.

As you can see below, a virtual machine called Workstation 1 is connected to the „Virtual machines internal” vdportgroup which in turn is on the vds called simply „ds”.

Workstation 1 connected to the distributed portgroup on the distributed virtual switch

Workstation 1 connected to the distributed portgroup on the distributed virtual switch

Virtual switches view

Virtual switches view

The VM is stored on the VMFS I datastore:

Datastore view

Datastore view

where one can also see a folder called .dvsData. Let’s have a look inside:

A look inside .dvsData folder

A look inside .dvsData folder

In the .dvsData folder there is a sub-folder which name suits the UUID of the distributed switch:

Checking vds's UUID with the esxcli command

Checking vds's UUID with the esxcli command

In this subfolder you will find one more files and their numbers will suit the number of ports the virtual machine(s) is connected to:

File listing

File listing

The file name's matches the port's number

That means that .dvsData will appear on the datastore where your VM’s configuration file (vmx) is stored. If you open the configuration file you will find the same information:

VM's configuration file networking part

VM's configuration file networking part

This information is synchronized (from vmx to .dvsData folder) by the host every 5 minutes. So now you know what this folder is, why subfolder and files’ names are so strange, etc. But what’s the purpose of the .dvsData folder and its content?

It is used by HA. Imagine the situation when your host fails and HA starts a VM on another physical server. It needs to know which port is should connect the machine to. I did a very simple test – I removed the file called 264 from the datastore and I stopped the ESXi server the VM Workstation 1 was running on. A few seconds later HA detected a possible failure of the host. However this was the result on the VM:

Oops, the failover failed...

Oops, the failover failed...

Leson learnt: don’t touch the folder .dvsData unless you really know what you are doing.

PS. As you see all operations in this note were done using the new Web-Client. More on this client soon.