Highlighted
Enthusiast
Enthusiast

vRA 7.3 - VMs with multiple IP addresses

Jump to solution

First, vRA is a pain to learn! I could go on, but here's the problem I'm having. I've setup a simple proof of concept environment, I'm trying to automate the deployment of VMs from two vCenter templates. One template exists on a single network, another on two networks. I'm able to deploy the single network template from the catalog without issue getting a correct static address from my range. The other has two static IP addresses, from two different subnets, which isn't working as expected.

I have two network profiles, lets called server and storage. One has a 10.x network, the other 172.x network. Each profile has a range of addresses I'm using for testing. These network profiles are linked to the Network adapter session in the Reservation.

The blueprint for the actual VM template is linked to a property group, which has two properties OS.VirtualMachine.Network0.ProfileName, and a second with 1 instead of 0. Each property definition has under the "Static List" section the network profile name for the "Value" field. I should now have everything linked to deploy a VM with two network adapters and get their respective IP address from the ranges setup in the network profile.

When my user account goes under the Catalog tab and selects Request, the next section shows the drop down boxes for choosing the networks before selecting submit. The VM gets deployed, however the addresses aren't correct. Sometimes I get two 10.x net address, two 172s, or one of each, but backwards. First time it deployed correctly oddly enough. But the address doesn't seem to get applied to the right adapter. Any ideas on how to get the addresses assigned correctly?

Also, since our DNS is external, the addresses and hostnames have been pre-staged. I'd need to somehow say "server01" always gets address 10.0.0.1, for instance. Is that possible here? And yes DHCP with DNS integration would solve this, currently working on but that's an internal non technical process.

Thanks for any help.

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Enthusiast
Enthusiast

Hi,

Have you tried using VirtualMachine.NetworkN.NetworkProfileName instead of VirtualMachine.NetworkN.ProfileName? Says in the documentation:

Use VirtualMachine.NetworkN.ProfileName to select any network from the reservation regardless of whether it has a corresponding network profile.

Use VirtualMachine.NetworkN.NetworkProfileName to only select networks that have a corresponding network profile with the same name.

Since you're using ProfileName maybe it's doing any, versus hard coding it with the same name?

View solution in original post

0 Kudos
7 Replies
Highlighted
Enthusiast
Enthusiast

Hi,

Have you tried using VirtualMachine.NetworkN.NetworkProfileName instead of VirtualMachine.NetworkN.ProfileName? Says in the documentation:

Use VirtualMachine.NetworkN.ProfileName to select any network from the reservation regardless of whether it has a corresponding network profile.

Use VirtualMachine.NetworkN.NetworkProfileName to only select networks that have a corresponding network profile with the same name.

Since you're using ProfileName maybe it's doing any, versus hard coding it with the same name?

View solution in original post

0 Kudos
Highlighted
Enthusiast
Enthusiast

Hi, thank you for the reply and suggestion. I created a couple new properties and modified the blue print custom properties tab to point to them. I was using a single property group, but switched to custom properties in my troubleshooting(this didn't seem to make a difference). After deploying 4 VMs to use up the address pool, I'm still left with the same problem, though 3 of the 4 VMs deployed correctly. This seems to be more correct using NetworkProfileName, rather than ProfileName though. I've attached a screenshot of the property definition in case I missed something here. Under the static list, that name correlates to the Network profile name under the Infrastructure/Network Profiles tab.

Appreciate any help, this is one of their more confusing products.

0 Kudos
Highlighted
Enthusiast
Enthusiast

I've never seen that definition prefixed with the OS name. Your property definitions says Linux.VirtualMachine.NetworkN.NetworkProfileName. Does it work if you just defined the custom property as VirtualMachine.NetworkN.NetworkProfileName?

0 Kudos
Highlighted
Enthusiast
Enthusiast

Trying to implement what you suggested. I may have been doing things incorrectly. When i tried to edit the custom property to use(VirtualMachine.Network0.NetworkProfileName), I got an error saying to use the Networks tab(error screenshot attached). After using this tab, I realized I probably should have been adding the networks to the canvas, and setting the network definitions here (screenshot). I would edit the custom property on the right and select my Network Profiles setup. However when I try to save I'd get an error saying I can't use profile and custom network property.

What path should I be taking here?

(I may not be able to respond again until tomorrow, thank you)

0 Kudos
Highlighted
Enthusiast
Enthusiast

By the way, I think you managed to get me on track. Applying this through the blueprint canvas assigns the correct addresses, unlike before!

We have DNS prestaged, is there anyway I can setup so that the hostname (configured through VM prefix) will match up with the IP addresses in the Network reservation? IE, server01 gets 10.0.0.1, servers02 gets 10.0.0.2, etc.

Thanks for your help.

0 Kudos
Highlighted
Enthusiast
Enthusiast

Look into the VirtualMachine.NetworkN.Address custom property to assign static IP addresses. When you order it, either manually in the GUI or through automated means, you could set the value for Network0 and Network1 to correlate with your DNS entries. There are some other properties for subnet mask and gateway as well. As long as it adheres to the network profile it should work (it will complain otherwise via exception). I would also recommend looking up some articles around custom host naming. You will inadvertently burn IPs if you are going off of the indexed machine prefix. For instance if you decom 01, it will free up the IP in the network reservation, but not the name. Next build will be 02 and so on and so fourth. A custom hostname will allow you to re-use IPs after they are reclaimed by vRA's reservation.

This is the document I've been referencing to in my replies for custom properties:

https://docs.vmware.com/en/vRealize-Automation/7.3/vrealize-automation-73-custom-properties.pdf

Glad you moved forward on this, good luck with your POC!

0 Kudos
Highlighted
Enthusiast
Enthusiast

Thanks, I'll read more on the custom properties. The documentation isn't as straight forward to me as with vSphere or Horizon. So far the only thing I really went through was the rainpole scenario guide. I'll give this a shot. Any way, I'll mark one of your replies as the correct answer seeing how you helped me out here. Thanks again.

0 Kudos