Is serverGuid Attribute Really Needed in vSphere?

If you have paid close attention to the SOAP messages recorded by Oynx, you may have noticed that there is an extra attribute called “serverGuid” in a ManagedObjectReference. The following is copied from my previous posting “Moving Virtual Machine to Distributed Virtual Switch”.

<_this xsi:type=”ManagedObjectReference” type=”VirtualMachine” serverGuid=”BA9CE658-75F7-4A99-ACE6-99EB1376B94A”>vm-134</_this>

Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.

Note that this SOAP request message is from a vSphere Client. In VIJava API or other language binding, there is no such an attribute. You may wonder, “will it make any difference while interacting with the vCenter or ESX/ESXi? Why is “serverGuid” there in vSphere Client?” Similar concern was raised in VI Java API forum yesterday. So I think it is worth an article on this topic.

For the first question, the answer is no. If you take a close look at the ManagedObjectReference data object in vSphere API reference, you will find only two properties defined: type and value. There is no additional property called “serverGuid.” Further looking into the core-types.xsd in vSphere Web Service SDK, you will find the following definition. It does not define “serverGuid.”

<complexType name="ManagedObjectReference">
<extension base="xsd:string">
<attribute name="type" type="xsd:string"/>

Because the WSDL is the ultimate interface definition, we can be fairly sure that the “serverGuid” attribute is not needed or expected by the server. Of course, the extra attribute doesn’t hurt much other than slightly extra bandwidth wasted. The servers just ignore it.

It doesn’t explain why serverGuid is in vSphere Client’s SOAP request. Let’s take a look at what value is serverGuid. It’s the UUID for a vCenter server the vSphere client connects to. If a vSphere Client manages only one vCenter at a time, it does not need this UUID. What about multiple vCenter servers at the same time? It does need extra information to tell which MOR is for which server. For that, the serverGuid is a good choice for representing vCenter server. And this happens to be vSphere Client’s choice.

Arguably, vSphere Client should remove the serverGuid attribute while generating the SOAP request message. As mentioned, it doesn’t hurt much, therefore no bother to do that. For folks who dig into the SOAP messages, it may be a little confusing.

BTW, I am sure you know in which case your vSphere Client talks to multiple vCenter. If not, check out this article.

This entry was posted in vSphere API and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


    My company has created products like vSearch ("Super vCenter"), vijavaNG APIs, EAM APIs, ICE tool. We also help clients with virtualization and cloud computing on customized development, training. Should you, or someone you know, need these products and services, please feel free to contact me: steve __AT__

    Me: Steve Jin, VMware vExpert who authored the VMware VI and vSphere SDK by Prentice Hall, and created the de factor open source vSphere Java API while working at VMware engineering. Companies like Cisco, EMC, NetApp, HP, Dell, VMware, are among the users of the API and other tools I developed for their products, internal IT orchestration, and test automation.