Monday, 6 March 2017

Deploying vSphere Data Protection From govc CLI

In vSphere 6.5 GA there have been a lot of reported instances where we are unable to deploy any ova template. In this article, I will be talking in specific to vSphere Data Protection. As you know, vSphere 6.5 supports only 6.1.3 of VDP. If you try to deploy this via the Web Client, you will run into issues stating "Use a 6.5 version of web client". The workaround would be to use the OVF-tool to have this appliance deployed on a vCenter. Personally, I find ovf tool to be a bit challenging for first time users. A simple way would be to use the govc CLI to have this template deployed. William Lam has this written about this in a greater detail as to what this tool is all about and you can read it here

Here, I am using a CentOS machine to stage the deployment. 

1. The first step would be to download the appropriate govc binary. To access the list, you can visit the gitHub link here. Once you have the required binary listed out in that link, run the below command to download the binary on to your Linux box.
# curl -L https://github.com/vmware/govmomi/releases/download/v0.5.0/govc_linux_386.gz | gunzip -d > /usr/local/bin/govc

I am using govc_linux_386.gz as it is compatible with my CentOS, if you are using a different distro or a windows based system, choose accordingly.

You should see a below task to indicate the download is in progress:

[root@centOS /]# curl -L https://github.com/vmware/govmomi/releases/download/v0.5.0/govc_linux_386.gz | gunzip -d > /usr/local/bin/govc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 6988k  100 6988k    0     0   713k      0  0:00:09  0:00:09 --:--:-- 1319k

2. Once the download is done, provide execute permissions to this binary. Run this command:
# chmod +x /usr/local/bin/govc

Note: The download can be done to any required directory.

3. Verify the download is successful and govc is working by checking for the version:
# govc version

You should see:
govc v0.5.0

4. We will have to set few environment variables to define which host, storage and network this VDP virtual machine should be deployed on. 

export GOVC_INSECURE=1
export GOVC_URL=<Specify-ESXi-or-VC-FQDN>
export GOVC_USERNAME=<User-login-for-the-above>
export GOVC_PASSWORD=<Your-Password>
export GOVC_DATASTORE=<Datastore-Name>
export GOVC_NETWORK=<Network-Portgroup>
export GOVC_RESOURCE_POOL=<Resource-pool-if-you-have-one>

5. Next, we will have to create a json specification file to provide the details of the VDP appliance. Run the below command to view the specification:
# govc import.spec /vSphereDataProtection-6.1.3.ova | python -m json.tool

You will notice the below:


6. Redirect this output to a file so that we can edit and provide the necessary details. Run this command:
# govc import.spec /vSphereDataProtection-6.1.3.ova | python -m json.tool > vdp.json

7. Open the file in a vi editor and enter the details for networking. Remove the first line which says "Deployment": "small", If this is not done, your deployment will fail with:
" govc: ServerFaultCode: A specified parameter was not correct: cisp.deploymentOption " 

You should have something similar post you edit the file:


Save the file.

8. Lastly, we will be deploying the ova template using the import.ova function. And during this deployment we will make use of the json file we created which has the networking details and the environment variables where we specified the location for ova deployment. The command would be:
# govc import.ova -options=vdp.json /vSphereDataProtection-6.1.3.ova

You should now see a progress bar:
[root@centOS ~]# govc import.ova -options=vdp.json /vSphereDataProtection-6.1.3.ova
[06-03-17 14:14:57] Warning: Line 139: Invalid value 'Isolated Network' for element 'Connection'.
[06-03-17 14:15:03] Uploading vSphereDataProtection-0.0TB-disk1.vmdk... (1%, 5.1MiB/s)

9. Post this you can power on your VDP appliance and begin the configuration. 

Hope this helps.