Ensuring no change in IP after redeployment
When you undeploy a vApp and then redeploy it, the IP of the vApp router or the NAT addresses might change (or even the MAC for that matter). Let's see what we can do about that.
Getting ready
If you would like to create a new vApp, you just need an External Network and a vApp template; we will create a vApp in this recipe.
If you like to retrofit a vApp, you need a vApp with a vApp Network that is attached to an Organization Network.
For testing purposes, use a second vApp or make a copy of the existing one. Leave the second one undeployed.
How to do it...
The following sections show how to ensure no change occurs in IP after redeployment by setting up the vApp and retrofitting an existing vApp.
Ensuring no change occurs in IP after redeployment by setting up the vApp
Perform the following steps:
- Go to your organization and click on My Cloud.
- Click on the green icon (+) to create a new vApp.
- Select a vApp and Next until you come to the Configure Networking section.
- Check Switch to the advanced networking workflow (bottom of the window).
- Make sure that the VMs are still configured to a vApp Network.
- In the Advanced Networking window, connect the vApp Network to an Organization Network:
- Check Retain IP/MAC resources.
- Close the wizard and deploy the vApp.
Ensuring no change occurs in IP after redeployment by retrofitting an existing vApp
Perform the following steps:
- Double-click on the vApp to enter it.
- Click on Networking.
- Click on the vApp Network that is connected to an Organization Network.
- Check the checkbox in Retain IP/MAC Resources as shown in the following screenshot:
- Click on Apply to save the changes.
- Your vApp is now configured and should not lose its IP/MAC settings when redeployed.
How it works...
While using a Static IP Pool, vCloud automatically takes over management of the IPs configured within the pool, meaning that, whenever a vApp router (Edge gateway) is deployed (when the vApp is powered on), an IP out of the IP pool will be allocated to it. When the vApp is undeployed (the vApp is powered off), the IP gets released back into the pool. You can access the IP allocation for each network by right-clicking on it and selecting IP Allocation. This also means that if you undeploy and then redeploy vApps that are connected to an External Network, you might get a different IP. This can be very tiresome, especially if you are using the IP for an RDP/SSH forward.
The setting for the default time for an IP release is set in Administration | General | IPaddress release timeout. The default value is 0 seconds. Increasing this setting to a higher value makes sure that vApps and VMs that are redeployed only for a short time keep their IP setting.
Please be aware that when you use this setting, you will deplete the available IPs in the Static IP Pool and you won't be able to deploy additional VMs until you have added more IPs to the pool or deleted VMs or vApps that are no longer required.
There's more...
If you would like to test these settings, follow the ensuing instructions:
- Double-click on your vApp to enter it.
- Click on Networking.
- Right-click on the vApp Network that has a vApp router configured, and select Configure Services.
- Click on NAT. Note down the IPs that are configured there.
- Exit with Cancel.
- Click back on the vApp folder, so you will see all the vApps you are currently having access to.
- Undeploy the vApp by clicking on the Stop button.
- Make sure you wait about a minute (or more depending on your IPaddress release timeout setting in General).
- Now deploy the other vApp.
- After deployment, check the IPs again.
- Now deploy the first vApp (that we switched off to retain the IP settings).
- Notice that the IPs are the same as before.
I might like to encourage you to test the reverse. However, you might need to reduce the number of IPs available in the pool to force the reallocation.