تغییر آدرس IP مربوط به VM ها در SRM5

تغییر آدرس 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

  1. Open the vSphere Web Client and log in to the vCenter Server at the Protected Site.
  2. On the left pane, go to Site Recovery.
  3. Under Inventories, select Recovery Plans.
  4. Open the already configured recovery plan, select the Related Objects tab and select theVirtual Machines.IP Addresses SRM P1-01
  5. Select the VM you want to edit and select Configure Recovery from the Actions You can also use the gear shaped button ?IP Addresses SRM P1-02
  6. 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.IP Addresses SRM P1-03
  7. 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.
  8. 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.IP Addresses SRM P1-04
  9. 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.IP Addresses SRM P1-05
  10. 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

  1. Open the vSphere Web Client and log in to the vCenter Server at the Protected Site.
  2. On the left pane, go to Site Recovery and then go to Sites.
  3. Select the Protected Site and log in if necessary.
  4. Select the Manage tab and then go to Network Mappings.IP Addresses SRM P2-01
  5. Select the network mapping created earlier and click the Add button under the IP Customization Rule.IP Addresses SRM P2-02
  6. 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.IP Addresses SRM P2-03
  7. 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

  1. With the vSphere Web Client still open on the protected site, go to Recovery Plans.
  2. Select the recovery plan, click on the Related Objects tab and go to the Virtual Machines
  3. Click on the Change the VM Recovery Settings button and select the IP Customization
  4. Select the Use IP customization rules if applicable option from the drop-down menu and click OK.IP Addresses SRM P2-04

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

  1. Log in on the vCenter Server or where the SRM Server is running.
  2. Open the Command Prompt.
  3. Change the directory to C:\Program Files\VMware\VMware vCenter Site Recovery Manager\bin
  4. 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
  5. Press Y when asked about the server thumbprint.
  6. Enter the administrator username and password.
  7. Press Y once again when asked about the server thumbprint.
  8. The file will be generated and placed in the folder specified by the –outDR IP Customizer 01

Modify the CSV file

  1. 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.
  2. The CSV file should look similar to the one depicted blow.DR IP Customizer 02
  3. 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.DR IP Customizer 03

Apply CSV file to virtual machines

  1. The final step is to import the CSV file back to SRM.
  2. 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
  3. Enter Y for the certificate warning.
  4. Provide the administrator username and password.
  5. Enter Y once again for the certificate warning.
  6. The DR IP Customizer will import the new settings and close the connection.DR IP Customizer 04

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.

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *