vdcrepadmin command-line interface (CLI) for reviewing the vSphere domain, the Platform Services Controllers (PSC), and checking the replication agreements configured and replication status within an environment.
/usr/lib/vmware-vmdir/bin"%VMWARE_CIS_HOME%"\vmdird\C:\Program Files\VMware\vCenter Server\Use the below parameters using the vdcrepadmin command-line interface (CLI) for reviewing the vSphere domain to check replication agreements configured and replication status within the environment:
Note: For vCenter 6.7 the showfederationstatus command was added to support additional debugging function.
vmdird folder.cd /usr/lib/vmware-vmdir/bincd "%VMWARE_CIS_HOME%"\vmdird\./vdcrepadmin -f showservers -h PSC_FQDN -u administrator -w Administrator_Password./vdcrepadmin -f showservers -h PSC_FQDN -u administrator -w 'Administrator_Password'-bash: ##### event not found, ensure that the use of the ' character not " is used to encapsulate the password../vdcrepadmin -f showservers -h psc1.example.local -u administrator -w passwordcn=psc1.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc2.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc4.example.local,cn=Servers,cn=East,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc3.example.local,cn=Servers,cn=East,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc1.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=localThe Platform Services Controller is named psc1.example.local.The Platform Services Controller is located in the home site within the vSphere domain.vmdird folder.cd /usr/lib/vmware-vmdir/bincd "%VMWARE_CIS_HOME%"\vmdird\Note: For 6.7, use: vdcrepadmin -f showfederationstatus -h localhost -u administrator -w Administrator_Password./vdcrepadmin -f showpartners -h PSC_FQDN -u administrator -w Administrator_Password
Example./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w password
This command provides PSC specified by -h parameter, partnership.
Example./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w passwordldap://psc2.example.local
4. Use the PSC from Step 3 to map out the topology of the current vSphere domain by re-running this command against each of the PSCs in order to determine all of the partnerships.
Example
Note: Use the showservers parameter to get a list of all of the PSCs in the domain.
./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w passwordldap://psc2.example.local./vdcrepadmin -f showpartners -h psc2.example.local -u administrator -w passwordldap://psc1.example.localldaps://psc3.example.local./vdcrepadmin -f showpartners -h psc3.example.local -u administrator -w passwordldap://psc4.example.localldaps://psc2.example.local./vdcrepadmin -f showpartners -h psc4.example.local -u administrator -w passwordldap://psc3.example.localvmdird folder.cd /usr/lib/vmware-vmdir/bincd "%VMWARE_CIS_HOME%"\vmdird\./vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w Administrator_Password./vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w passwordpsc3:~ # /usr/lib/vmware-vmdir/bin/vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w passwordPartner: psc4.example.localHost available: YesStatus available: YesMy last change number: 9502Partner has seen my change number: 9502Partner is 0 changes behind.Partner: psc2.example.localHost available: YesStatus available: YesMy last change number: 9502Partner has seen my change number: 9502Partner is 0 changes behind.psc3.example.local):psc2.* and another with psc4.*C/var/log/vmware/vmdird/vmdird-syslog.log or "%VMWARE_LOG_DIR%"\vmdird\vmdird-syslog.log file for details. This provides all information related to replication status and the objects that are replicated.cd /usr/lib/vmware-vmdir/bincd "%VMWARE_CIS_HOME%"\vmdird\./vdcrepadmin -f showpartners -h PSC_FQDN -u administrator -w Administrator_Password./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w password-h parameter, partnership../vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w passwordldap://psc2.example.local./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w passwordldap://psc2.example.local./vdcrepadmin -f showpartners -h psc2.example.local -u administrator -w passwordldap://psc1.example.localldaps://psc3.example.local./vdcrepadmin -f showpartners -h psc3.example.local -u administrator -w passwordldap://psc4.example.localldaps://psc2.example.local./vdcrepadmin -f showpartners -h psc4.example.local -u administrator -w passwordldap://psc3.example.local psc1.* and psc4.*../vdcrepadmin -f createagreement -2 -h Source_PSC_FQDN -H New_PSC_FQDN_to_Replicate -u administrator -w Administrator_Password
Example./vdcrepadmin -f createagreement -2 -h psc1.example.local -H psc4.example.local -u Administrator -w password
Note: PSC Names in the syntax is case sensitive. The vSphere Client will display the name in lower case. Be cautious of case sensitivity.
Use the following as an example as a visual representation of the recommended outcome.
After completion, repeat Step 4 to confirm that the environment is now in a ring topology.
Note: Due to replication time, it may take a few seconds to minutes for a complete ring topology to be configured.
cd /usr/lib/vmware-vmdir/bincd "%VMWARE_CIS_HOME%"\vmdird\./vdcrepadmin -f showpartners -h PSC_FQDN -u administrator -w Administrator_Password./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w password./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w passwordldap://psc2.example.local./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w passwordldap://psc2.example.localldaps://psc4.example.local./vdcrepadmin -f showpartners -h psc2.example.local -u administrator -w passwordldap://psc1.example.localldaps://psc3.example.local./vdcrepadmin -f showpartners -h psc3.example.local -u administrator -w passwordldap://psc4.example.localldaps://psc2.example.local./vdcrepadmin -f showpartners -h psc4.example.local -u administrator -w passwordldap://psc3.example.localldaps://psc1.example.local
psc1.* and psc4.*./vdcrepadmin -f removeagreement -2 -h Source_PSC_FQDN -H PSC_FQDN_to_Remove_from_Replication -u administrator -w Administrator_Password./vdcrepadmin -f removeagreement -2 -h psc1.example.local -H psc4.example.local -u Administrator -w passwordRunning each vdcrepadmin command requires the user to re-enter the password. As opposed to entering in the password for each of these 6 commands, multiplied by the amount of vCenter's in a SSO domain. This script automates the checking of all replication commands as well as the VMDIRD state. This script makes no changes, but instead runs the above replication agreement commands to read the present status and health of the vCenter's in a given SSO domain.
Usage
vi /tmp/elm.sh#!/bin/bash
read -p "Enter [email protected] password: " -s pw
clear
echo ">>>>>>>>>>>>>>>>>>>>>>"
echo "PNID"
/usr/lib/vmware-vmafd/bin/vmafd-cli get-pnid --server-name localhost
echo ">>>>>>>>>>>>>>>>>>>>>>"
echo " "
echo "########################################"
echo "ShowServers"
/usr/lib/vmware-vmdir/bin/vdcrepadmin -f showservers -h localhost -u administrator -w $pw
echo " "
echo " "
echo "########################################"
echo "ShowPartners"
/usr/lib/vmware-vmdir/bin/vdcrepadmin -f showpartners -h localhost -u administrator -w $pw
echo " "
echo " "
echo "########################################"
echo "ShowPartnerStatus"
/usr/lib/vmware-vmdir/bin/vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w $pw
echo " "
echo " "
echo "########################################"
echo "ShowFederationStatus"
/usr/lib/vmware-vmdir/bin/vdcrepadmin -f showfederationstatus -h localhost -u administrator -w $pw
echo " "
echo " "
echo "########################################"
echo "VMDIR State"
/usr/lib/vmware-vmafd/bin/dir-cli state get --password $pw
:wq!
chmod +x elm.sh
sed -i 's///' elm.shshowpartnerstatus CLI, monitor the current replication status across the environment. There are times in which replication may not be functioning properly and replication data from one PSC may not be reaching another PSC.psc1:~ # cd /usr/lib/vmware-vmdir/bin ./vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w passwordPartner: psc2.example.localHost available: YesStatus available: YesMy last change number: 12227Partner has seen my change number: 12222Partner is 5 changes behind. psc2:~ # cd /usr/lib/vmware-vmdir/bin ./vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w passwordPartner: psc1.example.localHost available: YesStatus available: YesMy last change number: 14539
Partner has seen my change number: 14539Partner is 0 changes behind.Partner: psc3.example.localHost available: YesStatus available: YesMy last change number: 14534
Partner has seen my change number: 14534Partner is 5 changes behind.psc2:~ # cd /usr/lib/vmware-vmdir/bin ./vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w passwordPartner: psc1.example.localHost available: YesStatus available: YesMy last change number: 14539Partner has seen my change number: 14539Partner is 0 changes behind.Partner: psc3.example.localHost available: YesStatus available: YesMy last change number: 14539Partner has seen my change number: 14539Partner is 0 changes behind.psc3:~ # cd /usr/lib/vmware-vmdir/bin ./vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w passwordPartner: psc4.example.localHost available: YesStatus available: YesMy last change number: 9530Partner has seen my change number: 9523Partner is 7 changes behind.Partner: psc2.example.localHost available: YesStatus available: YesMy last change number: 9530Partner has seen my change number: 9530Partner is 0 changes behind.psc3:~ # cd /usr/lib/vmware-vmdir/bin ./vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w passwordPartner: psc4.example.localHost available: YesStatus available: YesMy last change number: 9530Partner has seen my change number: 9530Partner is 0 changes behind.Partner: psc2.example.localHost available: YesStatus available: YesMy last change number: 9530Partner has seen my change number: 9530Partner is 0 changes behind.showservers, createagreements, and removeagreements CLI, the ability to update the vSphere Domain's replication topology as additional Platform Services Controllers are added to the environment.cd /usr/lib/vmware-vmdir/bincd "%VMWARE_CIS_HOME%"\vmdird\./vdcrepadmin -f showservers -h PSC_FQDN -u administrator -w Administrator_Password./vdcrepadmin -f showservers -h psc1.example.local -u administrator -w passwordcn=psc1.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc2.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc4.example.local,cn=Servers,cn=East,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc3.example.local,cn=Servers,cn=East,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc5.example.local,cn=Servers,cn=West,cn=Sites,cn=Configuration,dc=vsphere,dc=localcn=psc6.example.local,cn=Servers,cn=West,cn=Sites,cn=Configuration,dc=vsphere,dc=local
From the output, determine the required information. In this example:
- The Platform Services Controllers psc1.* and psc2.* are located within the site Home.
- The Platform Services Controllers psc3.* and psc4.* are located within the site East.
- The Platform Services Controllers psc5.* and psc6.* are located within the site West.
./vdcrepadmin -f showpartners -h PSC_FQDN -u administrator -w Administrator_Password./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w password./vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w passwordldap://psc2.example.localshowservers parameter to get a list of all of the PSCs in the domain../vdcrepadmin -f showpartners -h psc1.example.local -u administrator -wpasswordldap://psc2.example.localldaps://psc4.example.local./vdcrepadmin -f showpartners -h psc2.example.local -u administrator -wpasswordldap://psc1.example.localldaps://psc3.example.local./vdcrepadmin -f showpartners -h psc3.example.local -u administrator -wpasswordldap://psc4.example.localldaps://psc2.example.local./vdcrepadmin -f showpartners -h psc4.example.local -u administrator -wpasswordldap://psc3.example.localldaps://psc1.example.localldaps://psc5.example.local./vdcrepadmin -f showpartners -h psc5.example.local -u administrator -wpasswordldap://psc4.example.localldaps://psc6.example.local./vdcrepadmin -f showpartners -h psc6.example.local -u administrator -wpasswordldap://psc5.example.local
From this series of output, the following information can be determined:
- psc1.* has a replication partnership with both psc2* and psc4.*
- psc2.* has a replication partnership with both psc1.* and psc3.*
- psc3.* has a replication partnership with both psc2.* and psc4.*
- psc4.* has a replication partnership with both psc3.* , psc1.* and psc5.*
- psc5.* has a replication partnership with both psc4.* and psc6.*
- psc6.* has a replication partnership with psc5.*
./vdcrepadmin -f createagreement -2 -h Source_PSC_FQDN -H New_PSC_FQDN_to_Replicate -u administrator -w Administrator_Password./vdcrepadmin -f createagreement -2 -h psc1.example.local -H psc6.example.local -u Administrator -w password./vdcrepadmin -f removeagreement -2 -h Source_PSC_FQDN -H PSC_FQDN_to_Remove_from_Replication -u administrator -w Administrator_Password./vdcrepadmin -f removeagreement -2 -h psc1.example.local -H psc4.example.local -u Administrator -w password