I’ve been asked a couple of times about how vRealize Automation handles IP assignment and naming and the topic came up again recently. It isn’t always what people expect and although it’s pretty simple, it isn’t something widely documented.
Let’s have a look.
First we’ll create a new prefix called ‘test-vm-‘.
Next we’ll create a new network profile.
Finally we need to create and publish a blueprint which is configured to use our new prefix and network profile.
Now we have have a catalog item we can start to provision some VMs. First up we’ll create 5 new VMs.
If we check our network profile we can see that the first 5 machines names and IP addresses have been used as you’d expect.
Next we’ll delete VMs 1 and 5 and verify the IP’s have been marked as unallocated.
So what happens when we provision another 5 VMs? vRA will use the first unallocated address right? Well no. Actually it will carry on from where it left off as can be seen below. Note the names test-vm-1 and test-vm-5 have not been reused and neither have IP’s .210 and .214.
Also note that the name test-vm-0 has been used, this is a valid number in the prefix and it has cycled back round – we started our prefix from 1.
Finally let’s deploy another 2 VMs and confirm that the previous names and IP addresses will actually get used.
So everything will get reused but not necessarily in the order you’d expect.