vdcrepadmin
command-line interface (CLI) for reviewing the existing vSphere domain, Platform Services Controllers (PSC) that make up your vSphere domain as well as checking the replication agreements configured and replication status within your 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 existing vSphere domain to check replication agreements configured and replication status within your environment:
Note: For vCenter 6.7 the showfederationstatus
command was added to support additional debugging function.
vmdird
folder:cd /usr/lib/vmware-vmdir/bin
cd "%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"
vdcrepadmin -f showservers -h psc1.example.local -u administrator -w VMw@re123
cn=psc1.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=local
cn=psc2.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=local
cn=psc4.example.local,cn=Servers,cn=East,cn=Sites,cn=Configuration,dc=vsphere,dc=local
cn=psc3.example.local,cn=Servers,cn=East,cn=Sites,cn=Configuration,dc=vsphere,dc=loca
lcn=psc1.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=local
The Platform Services Controller is named PSC1.example.local.
The Platform Services Controller is located in the home site within the vSphere domain.
To determine this information, review the full output:
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.
vmdird
folder:cd /usr/lib/vmware-vmdir/bin
cd "%VMWARE_CIS_HOME%"\vmdird\
Note: For 6.7 -->vdcrepadmin -f showfederationstatus-h localhost -u administrator -w Administrator_Passwordvdcrepadmin -f showpartners -h PSC_FQDN -u administrator -w Administrator_Password
For example:vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
This command provides PSC specified by -h parameter, partnership.
For example:vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
ldap://psc2.example.local
showservers
parameter to get a list of all of the PSCs in the domain.vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
ldap://psc2.example.local
vdcrepadmin -f showpartners -h psc2.example.local -u administrator -w VMw@re123
ldap://psc1.example.local
ldaps://psc3.example.local
vdcrepadmin -f showpartners -h psc3.example.local -u administrator -w VMw@re123
ldap://psc4.example.local
ldaps://psc2.example.local
vdcrepadmin -f showpartners -h psc4.example.local -u administrator -w VMw@re123
ldap://psc3.example.local
vmdird
folder:cd /usr/lib/vmware-vmdir/bin
cd "%VMWARE_CIS_HOME%"\vmdird\
vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w Administrator_Password
vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w VMw@re123
psc3:~ # /usr/lib/vmware-vmdir/bin/vdcrepadmin -f showpartnerstatus -h localhost -u administrator -w VMw@re123
Partner: psc4.example.local
Host available: Yes
Status available: Yes
My last change number: 9502
Partner has seen my change number: 9502
Partner is 0 changes behind.
Partner: psc2.example.local
Host available: Yes
Status available: Yes
My last change number: 9502
Partner has seen my change number: 9502
Partner is 0 changes behind.
psc3.example.local
):psc2.*
and another with psc4.*
/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/bin
cd "%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 VMw@re123
-h
parameter, partnership.vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
ldap://psc2.example.local
vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
ldap://psc2.example.local
vdcrepadmin -f showpartners -h psc2.example.local -u administrator -w VMw@re123
ldap://psc1.example.local
ldaps://psc3.example.local
vdcrepadmin -f showpartners -h psc3.example.local -u administrator -w VMw@re123
ldap://psc4.example.local
ldaps://psc2.example.local
vdcrepadmin -f showpartners -h psc4.example.local -u administrator -w VMw@re123
ldap://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
vdcrepadmin -f createagreement -2 -h psc1.example.local -H psc4.example.local -u Administrator -w VMw@re123
NOTE: PSC Names in the syntax is case sensitive, vSphere Client shows the name in lower case. Be cautious in case sensitivity of PSC name
Use the following as a example as visual representation of the recommended outcome:
vmdird
folder:cd /usr/lib/vmware-vmdir/bin
cd "%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 VMw@re123
vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
ldap://psc2.example.local
vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
ldap://psc2.example.local
ldaps://psc4.example.local
vdcrepadmin -f showpartners -h psc2.example.local -u administrator -w VMw@re123
ldap://psc1.example.local
ldaps://psc3.example.local
vdcrepadmin -f showpartners -h psc3.example.local -u administrator -w VMw@re123
ldap://psc4.example.local
ldaps://psc2.example.local
vdcrepadmin -f showpartners -h psc4.example.local -u administrator -w VMw@re123
ldap://psc3.example.local
ldaps://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 VMw@re123
Running 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: Create a file on the vCenter (elm.sh
) using vi elm.sh
for example. Copy and paste the below bash script contents to the file and save with :wq!
From there to run chmod +x elm.sh
and ./elm.sh to print the replication health report from elm.sh
If you see a bad interpreter message as a result of copying between Windows and Linux. You can use this command on the vCenter to correct the formatting to allow the script to run successfully: sed -i -e 's/\r$//' 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
showpartnerstatus
CLI, you can monitor the current replication status across your environment. There are times in which replication may not be functioning properly and replication data from one PSC may not be reaching another PSC.showservers
, createagreements
and removeagreements
CLI, you can update your vSphere Domain's replication topology as addition Platform Services Controllers are added to your environment.vmdird
folder:cd /usr/lib/vmware-vmdir/bin
cd "%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 VMw@re123
cn=psc1.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=local
cn=psc2.example.local,cn=Servers,cn=home,cn=Sites,cn=Configuration,dc=vsphere,dc=local
cn=psc4.example.local,cn=Servers,cn=East,cn=Sites,cn=Configuration,dc=vsphere,dc=local
cn=psc3.example.local,cn=Servers,cn=East,cn=Sites,cn=Configuration,dc=vsphere,dc=local
cn=psc5.example.local,cn=Servers,cn=West,cn=Sites,cn=Configuration,dc=vsphere,dc=local
cn=psc6.example.local,cn=Servers,cn=West,cn=Sites,cn=Configuration,dc=vsphere,dc=local
From the output, you can determine the required information.
- 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 VMw@re123
vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
ldap://psc2.example.local
showservers
parameter to get a list of all of the PSCs in the domain.vdcrepadmin -f showpartners -h psc1.example.local -u administrator -w VMw@re123
ldap://psc2.example.local
ldaps://psc4.example.local
vdcrepadmin -f showpartners -h psc2.example.local -u administrator -w VMw@re123
ldap://psc1.example.local
ldaps://psc3.example.local
vdcrepadmin -f showpartners -h psc3.example.local -u administrator -w VMw@re123
ldap://psc4.example.local
ldaps://psc2.example.local
vdcrepadmin -f showpartners -h psc4.example.local -u administrator -w VMw@re123
ldap://psc3.example.local
ldaps://psc1.example.local
ldaps://psc5.example.local
vdcrepadmin -f showpartners -h psc5.example.local -u administrator -w VMw@re123
ldap://psc4.example.local
ldaps://psc6.example.local
vdcrepadmin -f showpartners -h psc6.example.local -u administrator -w VMw@re123
ldap://psc5.example.local
From this series of output, you can determine these informtion:
- 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 VMw@re123
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 VMw@re123
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
When you run the above commands if you get the error "bash: vdcrepadmin: command not found", then try the below steps to address it:
Once you cd into the right directory where vdcrepadmin
is you can try to append ./ to the command so example: ./vdcrepadmin