VMware {code} Community
mingma
Contributor
Contributor

vmci socket CID for vMA

Hi,

If I want to use vMA as a vmci socket server on hundreds of physical machines, I want to create and use some well defined CID so that all client VMs can connect to some well defined CID. The one I get is 3808257003. After I reinstall vMA, the number remains the same. Can I assume this is a unique CID reserved for vMA? How are CID generated for general VMs? I want to make sure there won't be conflicts.

Thanks.

0 Kudos
3 Replies
svaerke
VMware Employee
VMware Employee

The initial CID for a VM is generated from the UUID of the VM. If that CID is already in use on the physical machine, another CID will be assigned. Once a CID has been assigned, it will be stored in the VM config file and reused if possible. However, while a VM is powered off, other VMs may be assigned the same CID, so each time the VM is powered on, vmotioned, or restored from a suspended state, the CID of the VM may change if another running VM has been assigned the same CID. So it isn't possible to ensure that a given VM always has the same CID.

Through the vSphere API you can get the CID of a running VM since the CID is available as part of the VMCI device state exposed, and then supply that CID to the clients.

mingma
Contributor
Contributor

Thanks! The vmci socket API allows the program to get the CID of the local VM. Can a VM get the CID of another VM? http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.vm.device.VirtualVMCI... isn't clear about this.

1. If the program on one VM can find the CID of another VM based on its name, then,we can do below.

a) define some unique name for vMA so VMs on all physical machines know about it.

b) look it up by the unique name and get the CID.

2. If the program on one VM can't find the CID of another VM based on its name, then we can do below.

a). Write up a new service for lookup.

b). When vMA is up, it update the service with its CID.

c)  Regular VMs will lookup vMA's CID via the service.

Any ideas?

0 Kudos
svaerke
VMware Employee
VMware Employee

Hi,

In general, one VM cannot get the CID of another VM. If you already have a VMCI stream socket connection, you can get the peer address, but that has little value in your case.

So your best option is to implement a user world that acts as  a broker as you describe in 2).

Thanks

0 Kudos