You must write a script that you run in the virtual machine that contains the extension.
The script reads the URL of the vCenter Extension vService Guest API, SSL thumbprint, and authentication token in the <vServiceEnvironmentSection> element of the Open Virtualization Format (OVF) environment XML file. The script authenticates itself with the vCenter Extension vService using the authentication token from the vService environment, generates a self-signed certificate, and sends the extension key and certificate to the RegisterExtension function from the vCenter Extension vService Guest API.
The script that you run in the guest operating system of the virtual machine must perform the following functions.
Prerequisites
-
You have developed an extension running in a virtual machine that you deliver using OVF.
-
You have configured the OVF descriptor file of the extension to depend on the vCenter Extension vService and enabled OVF transport.
Procedure
Results
Example: vServiceEnvironmentSection in the OVF Environment XML File
If you add a vService dependency in an OVF descriptor from which you deploy an extension, the vCenter Extension vService generates and adds a <vServiceEnvironmentSection> element to the OVF environment of the virtual machine that it deploys.
<ve:vServiceEnvironmentSection xmlns:ve="http://www.vmware.com/schema/ovfenv"
xmlns:evs="http://www.vmware.com/schema/vservice/ExtensionVService"
ve:bound="true" ve:id="installation"
ve:type="com.vmware.vservice.extension">
<evs:GuestApi>
<evs:URL>https://192.168.1.42/vsm/extensionService</evs:URL>
<evs:Token>1efc34a14232f81a245b9e8172f7a383fdeab312</evs:Token>
<evs:X509Thumbprint>2b:04:e6:7d:8c:7b:73:70:d4:29:32:ed:96:11:2b:ae:b4:a0:28:78</evs:X509Thumbprint>
</evs:GuestApi>
<evs:VCenterApi>
<evs:IP>192.168.1.42</evs:IP>
<evs:X509Thumbprint>2b:04:e6:7d:8c:7b:73:70:d4:29:32:ed:96:11:2b:ae:b4:a0:28:78</evs:X509Thumbprint>
<evs:HttpPort>80</evs:HttpPort>
<evs:HttpsPort>443</evs:HttpsPort>
<evs:SelfMoRef>VirtualMachine:vm-246</evs:SelfMoRef>
</evs:VCenterApi>
</ve:vServiceEnvironmentSection>