Question

How is VIP swapping + CNAMEs better than IP swapping + A records?

As a continuation from the above - I'm very close to reverting back to A records due to issues I'm having with CNAMEs in Azure.

From the Azure docs, it's stated:

Note, however, because the lifetime of the IP address is associated with a deployment, it is important not to delete your deployment if you need the IP address to persist. Conveniently, the IP address of a given deployment slot (production or staging) is persisted when using the two upgrade mechanisms in Windows Azure: VIP swaps and in-place upgrades.

I have myapp.cloudapp.net, currently pointing to a VIP of 1.1.1.1. If I want to deploy a version of my application to Staging, I'll spin the Staging slot up with my application, do some testing, and then do a seamless upgrade via VIP swap. The application will now be using 2.2.2.2 - though if I do a DNS lookup again at this point, the A record for myapp.cloudapp.net will still point to 1.1.1.1, since VIP swaps have no impact on DNS, right?

If so, then what happens when I kill my staging deployment to save cost? Will both 1.1.1.1 and 2.2.2.2 be reserved for my service? I hope so, because that means I can have my A record point to 1.1.1.1 all the time, depend on it through staging deployments, and not worry about CNAME hassles. But that means that this answer is incorrect.

If not, then this means that VIP swaps do have effects on DNS records, right? Otherwise, I would be able to do this:

  • 1.1.1.1 > 2.2.2.2, drop staging, 1.1.1.1 gets recycled
  • spin up staging again, 2.2.2.2 > 3.3.3.3, yet DNS A records still point to 1.1.1.1 for myapp.cloudapp.net.

That last bit wouldn't make any sense, so either DNS records do get updated, or 3.3.3.3 never enters the picture, and 1.1.1.1 and 2.2.2.2 are always together, as long as my cloud service doesn't get deleted.

I'm very confused with this matter - any guidance would be great.

UPDATE - I just tested this with the following:

CHECK DNS - get 1.1.1.1
READ PROD - get 1.1.1.1
DEPLOY STAGING
READ STAGING - get 2.2.2.2
VIP SWAP
READ PROD - get 1.1.1.1
READ STAGING - get 2.2.2.2
CHECK DNS - get 1.1.1.1
KILL STAGING DEPLOYMENT
READ PROD - get 1.1.1.1

So it appears that A records CAN be used - even when switching between staging / production, the PROD VIP stays the same, but the deployments get swapped. Dropping staging and re-deploying staging gets a new secondary VIP, but the primary VIP does stay constant. I'll wait until someone more reliable than me can chime in here before posting this as an answer.

Was it helpful?

Solution

VIP swap will not change your public IP. That's saying, if you have your application deployed in prod slot with 1.1.1.1 and beta deployed in staging slot with 2.2.2.2, your public IP will still be 1.1.1.1 even after VIP swapped. This is because VIP is just a load balance configuration changing. You can safely delete your original application from the staging slot (originally prod slot) which the IP was 2.2.2.2.

Hope this helps,

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top