In SRM 5 we have a new interface to managing the IP information of protected virtual machines. It makes it easy to change or update IP information for a virtual machine. You can see what the SRM UI looks like here. See below for what the new UI for editing IP addresses in SRM 5 looks like.
(BTW, you get to this screen by right clicking on a VM listed in a Recovery Plan and selecting Configure) Notice how you can edit both the protected and recovery sides here? This is to facilitate failback operations. But this is – while much improved – very much one VM at a time. If you have 10 VM or more you likely will be very tired of doing your IP customization in the UI.
We have a command line utility that is good for bulk IP customization and I use it for even less than 10 virtual machines as it is easy (once you know how and have done it once) and it is harder to make mistakes. It can be used to configure protected and recovery sites so that you are ready for failback operations – after all, if you only do the IP customization for the failover site, how will you be able to failback?
This blog will show some samples of how to use the command line tool that is called dr-ip-customizer. So lets get started.
The tool is found in the BIN folder that is by default found in:
C:\program files (x86)\vmware\vmware vcenter site recovery manager\bin
The drive letter will likely change in your world but the path should be very similar.
The steps below will help you use the tool to implement IP customization for a number of VMs and you should be able to use these steps in your own infrastructure.
Once you are at the command line and are in the BIN folder you can use the command below for more info:
This command will show you the info below.
It is important to understand that you must use these commands – always – on the same side. So use them on one side, or the other consistently - I always use them on recovery side myself. Do not start using them on one side, and than finish on the other side. This will confuse the technology and it will not work. So start working on one or the other side and finish there.
We need to create a .csv file with a list of our protected VMs in it.
Dr-ip-customizer.exe --cfg ..\config\vmware-dr-xml --o c:\example.csv --cmd generate --vc FQDN_of_The_Local_vCenter
Above we see a wrapped line, but it is actually one long line.
You will now have a .CSV file that you can work with - c:\example.csv in this case. You should use Excel to work on it.
This is what you will see when you first look at the CSV file.
We need to edit the spreadsheet in a specific way so that it can be imported to SRM without error.
Each VM will require four lines in this spread sheet so you will need to insert some (make sure to keep the begining of the lines as they were - you only make changes in the Adapter column and to the right). Each VM will have two lines (0 and 1) for each side (the vC is used to denote which side you are configuring). This is how you can have IP changed during failing over, and than changed back when you fail back to the orginal side. If a VM has more than one adapter, they will need another line but numbered as Adapter 2 or higher. If a VM has more than one gateway, you will need another line for the second gateway address.
When we are finished it will look like the one below.
This CSV has filled in both protected and recovery side information, which is done by the vCenter reference. This is important for failback operations but it is not necessary.
Now the CSV has been updated, we can upload it to SRM and have the IP specification information attached to the appropriate VMs.
Dr-ip-customizer.exe --cfg ..\config\vmware-dr-xml --csv c:\example.csv --cmd apply --vc FQDN_of_The_Local_vCenter
Now you can visit one of the virtual machines you have just managed the IP Customization settings for and see what you have done. You should see something like you see below.
Some things to remember
- Make sure you test your work. You do this with a test failover, but also by looking at the properties of the VM in the recovery plan as seen above.
- One IPv4 or one IPv6 addresses per adapter.
- Don’t empty or clear a cell while working in the CSV with the spacebar!
- The vC names used in the command line should be the same as you used in the SRM registration.
- Generally one row per adapter. Multiple values, like for DNS servers would require multiple lines.
- Adapter ID=0 is only used for global IP settings like DNS Server(s), DNS Suffix (s).
- IPv6 fields can be empty but not IPv4. If you are using IPv6 and want to leave IPv4 blank put a dhcp (not DHCP) in the IPv4 area.
- Keep a master copy of the spreadsheet so that you have something to work in, and you can always paste the appropriate info into a different CSV file you upload.
- The --cmd can have the values of generate (the CSV file), apply (upload your configuration info), and drop (for deleting the IP information).
You have seen how to use the dr-ip-customizer command line tool to configure bulk numbers of VMs with IP customization information. Different in this release is the ability to do IP information for both the protected and recovery sides to support failback.
If you have any questions on this please do not hesitate to leave a comment for me. This blog was carefully tested on a pre - GA release of SRM. If necessary I will update it for the GA release.