تغییر آدرس IP مربوط به VM ها در SRM5
In one of my previous blog posts (Back to Basics – SRM – Part 4: Inventory Mappings) I briefly touched the subject on adding an IP address customization rule when creating the inventory mappings and in this article we will have a closer look on how to configure the IP addresses customization in SRM.
According to the vCenter Site Recovery Manager Administration Guide, the vCenter Site Recovery Manager supports different types of IP customization:
- Use of IPv4 and IPv6 addresses.
- Configure different IP customizations for each site.
- Use DHCP, Static IPv4, or Static IPv6 addresses.
- Customize addresses of Windows and Linux virtual machines.
- Customize multiple NICs for each virtual machine.
In vCenter Site Recovery Manager there are 2 ways to apply the IP addresses customization to the virtual machines. Actually, there are 3 ways as the second method can be configured in two different ways.
- Manually customize IP addresses for an Individual virtual machine or
- Customizing IP addresses for multiple virtual machines:
- By defining IP Customization Rules or
- By using the DR IP Customizer tool
In this post we will have a closer look at the first option, customize an IP address for an individual virtual machine. This option is valid if you don’t have a lot of virtual machines running in your environment.
Manually Customize IP addresses
- Open the vSphere Web Client and log in to the vCenter Server at the Protected Site.
- On the left pane, go to Site Recovery.
- Under Inventories, select Recovery Plans.
- Open the already configured recovery plan, select the Related Objects tab and select theVirtual Machines.
- Select the VM you want to edit and select Configure Recovery from the Actions You can also use the gear shaped button ?
- In the VM Recovery Properties window, select the IP Customization tab, set the IP Customization mode to Manual IP Customization and select the NIC of the VM. The IP settings of this VM should now be visible.
- At the bottom of the table, there are 2 options: Configure Protection and Configure Recovery which correspond with the Protected Site IP settings and the Recovery Site IP settings. Depending on your requirements, you can change the IP addresses for both sites. In my case I will enter a manual IP address for each site.
- Click the Configure Protection button and enter the IP address, subnet mask, default gateway and the DNS server for this VM on the Protected Site.
- Repeat the process for the IP address on the Recovery Site. When finished, the table in the VM recovery Properties window should look similar to the one depicted below.
- Click OK to close the window. When the configuration process is finished you should get a notification message in the vSphere Web Client stating that the protected VM has been successfully reconfigured.
At this point the VM IP address is customized. You can now test the recovery plan to see if the custom IP settings are being applied.
This concludes the manual IP address customization method in vCenter Site Recover Manager.Proceed to part 2 where we will have a closer look at the IP address customization process for multiple virtual machines by defining the IP customization rules.
In the previous part we had a closer look at customizing the IP addresses in SRM using the manual method. In this part, we will customize the IP addresses for multiple virtual machines by defining the IP customization rules in SRM.
I will not go into the small details of how this process works. It is very well documented in the vCenter Site Recovery Manager 5.8 Administrator Guide on page 77 and 78 in the “Customize IP Properties for Multiple Virtual Machines by Defining IP Customization Rules” sub-chapter which you should read anyway. ?
Also, according to the administrator guide, the IP subnet mapping rules support IPv4 only. Rule-based IPv6 customization is not supported.
Customizing IP addresses for multiple VM’s by defining the IP customization rules
- Open the vSphere Web Client and log in to the vCenter Server at the Protected Site.
- On the left pane, go to Site Recovery and then go to Sites.
- Select the Protected Site and log in if necessary.
- Select the Manage tab and then go to Network Mappings.
- Select the network mapping created earlier and click the Add button under the IP Customization Rule.
- In the Add IP Customization Rule window, enter a rule name, specify the subnet IP ranges on the protected and recovery sites. Enter the default gateway, DNS servers and other necessary network settings that will be applied to the recovery site.
- Click OK to close the window and create the new IP customization rule.
The rule should now be visible when you select the network mapping in the vSphere Web Client.
The final step is to apply the IP customization rule to the recovery settings of the protected virtual machines.
Apply IP Customization Rules to VM’s
- With the vSphere Web Client still open on the protected site, go to Recovery Plans.
- Select the recovery plan, click on the Related Objects tab and go to the Virtual Machines
- Click on the Change the VM Recovery Settings button and select the IP Customization
- Select the Use IP customization rules if applicable option from the drop-down menu and click OK.
When the recovery settings are applied you should see a message in the vSphere Web Client stating that the protected VM has been successfully reconfigured.
This concludes a rather short post on customizing IP addresses in SRM by defining the IP customization rule. Continue to part 3 (coming soon) where we will configure the IP addresses in SRM using the DR Customization tool.
Cheers!
In the previous part we had a closer look at customizing the IP addresses of multiple virtual machines in SRM using the IP customization rules. In this final part of customizing IP addresses in SRM 5, we will customize the IP addresses for multiple virtual machines using the DR IP Customizer tool which is installed with SRM.
According to the Site Recovery Manager Administrator Guide, the DR IP Customizer tool allows you to define explicit IP customization settings for multiple protected virtual machines on the protected and recovery sites. In addition to defining subnet IP mapping rules, you can use the DR IP Customizer tool to apply customized networking settings to virtual machines when they start on the recovery site. You provide the customized IP settings to the DR IP Customizer tool in a (CSV) file.
There is also a list of guest OS’s which SRM 5 supports with IP addresses customization. Check theCompatibility Matrixes for vCenter Site Recovery Manager.
Run DR IP Customizer to generate CSV file
- Log in on the vCenter Server or where the SRM Server is running.
- Open the Command Prompt.
- Change the directory to C:\Program Files\VMware\VMware vCenter Site Recovery Manager\bin
- Run the dr-ip-customizer.exe command to generate a CSV file. For example: C:\>dr-ip-customizer.exe –cfg ..\config\vmware-dr.xml –cmd generate –out “C:\IPAddressesProtected.csv” –vc vCenter.dr-lab-a.local
- Press Y when asked about the server thumbprint.
- Enter the administrator username and password.
- Press Y once again when asked about the server thumbprint.
- The file will be generated and placed in the folder specified by the –out
Modify the CSV file
- Open the file. I am using Excel 2013. Remember to import the file instead of opening it directly. Use the Get External Data under the Data
menu. - The CSV file should look similar to the one depicted blow.
- As you can see, each VM is listed twice. This is because you have to set the IP address settings for each VM on the Protected Site and the Recovery Site. Populate the CSV file accordingly and save it. The options and examples on how to set for example DHCP address are well documented in the Site Recovery Manager Administrator Guide.
Apply CSV file to virtual machines
- The final step is to import the CSV file back to SRM.
- Enter the following command from the command prompt in the “C:\Program Files\VMware\VMware vCenter Site Recovery Manager\bin” directory: C:\>dr-ip-customizer.exe –cfg ..\config\vmware-dr.xml –cmd apply –csv “C:\IPAddressesProtected.csv” –vc vCenter.dr-lab-a.local
- Enter Y for the certificate warning.
- Provide the administrator username and password.
- Enter Y once again for the certificate warning.
- The DR IP Customizer will import the new settings and close the connection.
This concludes the final part in the Customizing IP addresses for VM’s in SRM 5 series. As you can see, there three different ways to set the IP addresses on the virtual machines in SRM. I think that you should evaluate all three possibilities and choose the option that is best suitable for your environment and your business.