Tuesday, 2 May 2017

Script For VDP Proxy Registration Issue

Earlier in this article here we saw the issue where post an upgrade of VDP the ignore_vc_certificate parameter is flipped to false because of which the proxy registration fails. If you would like to edit the files manually you can follow that article. Else, you can use the attached script in this one.
The script basically changes the parameter, restarts the MCS and re-registers the internal proxy to vCenter.

Download the script, place it in your /home/directory of VDP appliance and run the script while logged in as admin. Provide the script a+x permissions.

You can download the script from github here:
https://github.com/happycow92/shellscripts/
https://github.com/happycow92/shellscripts/blob/master/proxy-fix.sh

The script:

#!/bin/bash
echo -e "***************************************"
echo -e "* This script is written by Suhas G  *"
echo -e "*          gsuhas@vmware.com          *"
echo -e "***************************************"
echo -e "This script fixes vCenter certificate parameter for proxy\n"
echo -e "The current value for ignore_vc_cert is\n"
value=$(cat /usr/local/avamar/var/mc/server_data/prefs/mcserver.xml | grep ignore_vc_cert | cut -d = -f 3 | cut -d " " -f 1)
echo $value
read -p "Proceed with fix?: " choice

case "$choice" in
y|Y )
sed -i -e 's/entry key="ignore_vc_cert" value="false"/entry key="ignore_vc_cert" value="true"/g'  /usr/local/avamar/var/mc/server_data/prefs/mcserver.xml
echo -e "\nThe new value for ignore_vc_cert is"
value=$(cat /usr/local/avamar/var/mc/server_data/prefs/mcserver.xml | grep ignore_vc_cert | cut -d = -f 3 | cut -d " " -f 1)
echo $value
echo -e "\nProceeding to restart MCS"
mcserver.sh --restart --verbose
echo -e "\nProceeding to re-register internal proxy"
sudo /usr/local/avamarclient/etc/initproxy.sh --start
echo -e "\nAll done!";;
n|N )
echo -e "\nExiting script";;
esac
If there are any issues reach out to me. Hope this helps.