vdswitch分佈式虛擬交換機配置文件在存儲中的位置

 

vdswitch分佈式虛擬交換機配置文件在存儲中的位置

Have you ever wondered what those .dvsData folder is on some of your datastores ? Well in this article I will give some insight to them and what they are used for.
Firstly some information around a vDS switch. Each vDS switch has a UUID in the format : "6a de 0e 50 80 32 76 68-e0 72 fd 00 c3 23 52 92" (as an example). When you look inside a datastore you will sometimes (Will explain just now on when) a .dvsData folder. If you look in there you will see 1 or more of these numbers. Each number correspond to a vDS switch that is used by the ESXi host.
So some rules around these files :
  • The .dvsData folder is only created if you have a VM on that datastore that is attached to a vDS. Thus if there is only VM's that is attached to a vSwitch on a datastore there will not be a .dvsData folder. Also only the datastore that holds the .vmx config file will have the .dvsData folder.
  • Inside the .dvsData folder there is a UUID number for each vDS switch.
  • Inside the UUID folder is a smaller file that is a number. This number corresponds to the ethernetx.dvs.portId inside the .vmx file of a VM. Below we can see that ethernet0.dvs.portId=10.




    ethernet0.dvs.switchId = "6a de 0e 50 80 32 76 68-e0 72 fd 00 c3 23 52 92"
    ethernet0.dvs.portId = "10"
    ethernet0.dvs.portgroupId = "dvportgroup-208"
    ethernet0.dvs.connectionId = "177280995"
Now why is this file ("10") important ? It is needed by HA to restart the VM on another host. Certain information (Port state, MTU, run time packets stats) must be transferred to the new host when starting up the VM and this file has that information. In a vMotion of a VM this information is transferred as part of the copy to the other host.
There is some config files that also important:
  • /etc/vmware/ dvsdata.db
    • Updated by hostd every 5 min
    • Contains data for persistent vdPorts (vmkernel)
  • The smaller files ("10" in our case)
    • Updated with vdPort information every 5 min by hostd
    • Contains data for the VM's vNIC's that is attached to the vDS
-------------------------------------------------------------------------------------------------------------------
Comment: vDS:虛擬化分佈交換機(Virtual Distributed Switch)

Virtual老薛翻譯版:
    
       大家曾經有沒有懷疑過在Datastore中的.dvsData是幹嘛用的?這篇文章我將給出這些代表什麼和它的作用。       首先是一些圍繞 vDS switch的信息,每一個vDS switch都有一個 UUID:"6a de 0e 50 80 32 76 68-e0 72 fd 00 c3 23 52 92" (舉例說明),你展開.dvsData 文件夾可以看到這些號碼,每一串數字都對應一個vDS switch,可以被ESXi所使用。       文件規則:
                        1. .dvsData文件只在Datastore中有VM使用到 vDS時才被創建,因此如果VM只綁定了普通vswitch的時候該文件夾不會出現, 也只有當Datastore中有 .vmx config文件的時候.dvsData纔會被創建
                        2. Datastore裏邊是每一個UUID number對應相應的
vDS switch.爲一個文件夾
                        3.UUID 文件夾裏邊是一個以數字命名的小文件,這個數字對應.vmx config文件裏的ethernetx.dvs.portId項,這個小文件名是10則 ethernet0.dvs.portId=10下面是我Virtual老薛自己的截圖:


大家可以看到dvs.portId號碼對應了虛擬交換機上面的端口號



爲什麼這個dvs.portId很重要?因爲HA在其他機器上面啓動的時候需要這個文件(vDS的發明主要作用就是爲了統一管理虛擬網絡交換機,如果交換機的配置不一樣HA是切換不過來的),啓動的時候Port state, MTU, run time packets stats需要被傳輸到新的ESXi主機上,vMotion同理
配置文件保存在系統的:/etc/vmware/ dvsdata.db 每5分鐘會被Host更新一次
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章