VMware Cloud Community
prestonville
Enthusiast
Enthusiast
Jump to solution

How do I edit IP assignemnts in Network Profiles in vRA

A VM have been provisioned using a VLAN defined in a Network Profile. An IP has then been allocated to the VM from the network profile. All good but VM has then been manually edited to have a new IP and VLAN assigned replacing the original vRA defined IP and VLAN. Does anyone know how I can remove the old IP from the vRA network profile ?

Going forward we are developing a vRO workflow to allow the users to run a job to alter the VM custom properties to then alter the VM IP in the profile.

Thanks

Prestonville

1 Solution

Accepted Solutions
vMarkusK1985
Expert
Expert
Jump to solution

Its not official supported, but you can do it in the vCAC SQL Database (here via vCO):

var date   = new Date();

var query  = "UPDATE [dbo].[StaticIPv4Address]";

query += " SET [Hostname] = ''";

query += " ,[VirtualMachineID] = NULL";

query += " ,[StaticIPv4AddressState] = 1";

query += " ,[LastModifiedDate] = '" + System.formatDate( date,"yyyy-MM-dd HH:mm:ss" ) + "'";

query += " WHERE [IPv4Address] = '" + IpAddress + "'";

query += " AND [StaticIPv4NetworkProfileID] LIKE '" + networkProfile + "'";

var resultRecords = database.executeCustomQuery( query );

Kind Regards,

Markus

https://mycloudrevolution.com | https://twitter.com/vMarkus_K | https://github.com/vMarkusK

View solution in original post

Reply
0 Kudos
11 Replies
v1gnesh
Enthusiast
Enthusiast
Jump to solution

I believe a scan happens at some interval to update the state of the IP addresses in a Network Profile.

Running Data Collection might help.

EDIT:


"When a machine that has a static IP address is destroyed, its IP address is made available for use by other machines. The process to reclaim static IP addresses runs every 30 minutes, so unused addresses may not be available immediately after the machines using them are destroyed. If there are not available IP addresses in the network profile, machines cannot be provisioned with static IP assignment on the associated network path."

Source: vRealize Automation 6.2 Documentation Center

EDIT2:

Since you're updating the IP address and VLAN after provisioning, is it an option for you to consider allowing the user to select the Network Profile at provisioning time using VirtualMachine.NetworkN.ProfileName? To do this you would have to consider the prioritization of Custom Properties and find out addition at which location A (for ex.) overrides/outweighs addition at location B (for ex.). See http://dailyhypervisor.com/wp-content/plugins/downloads-manager/upload/Custom%20Property%20Overrides...

vMarkusK1985
Expert
Expert
Jump to solution

Its not official supported, but you can do it in the vCAC SQL Database (here via vCO):

var date   = new Date();

var query  = "UPDATE [dbo].[StaticIPv4Address]";

query += " SET [Hostname] = ''";

query += " ,[VirtualMachineID] = NULL";

query += " ,[StaticIPv4AddressState] = 1";

query += " ,[LastModifiedDate] = '" + System.formatDate( date,"yyyy-MM-dd HH:mm:ss" ) + "'";

query += " WHERE [IPv4Address] = '" + IpAddress + "'";

query += " AND [StaticIPv4NetworkProfileID] LIKE '" + networkProfile + "'";

var resultRecords = database.executeCustomQuery( query );

Kind Regards,

Markus

https://mycloudrevolution.com | https://twitter.com/vMarkus_K | https://github.com/vMarkusK
Reply
0 Kudos
Venom83
Enthusiast
Enthusiast
Jump to solution

Thank you, I've used your idea to write a PowerShell script with SQL query that scans the table for all IP addresses with status "2" (=destroyed) and sets them to "1" (=unallocated).

Ran by the vRO using XaaS CI Smiley Happy

YannMichalak
Enthusiast
Enthusiast
Jump to solution

:smileydevil:   :smileyalert: since 2015 :smileyshocked:

Yep,

on vRA 7.3 it's not possible to modify the timer for the process to reclaim static IP ?

Thx for your help.

Reply
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

There is, yes, but it already runs every 5 minutes. Is that really not fast enough for you? In any case, all of the system-level workflows can have their intervals adjusted.

pastedImage_0.png

Find and edit ManagementModelSchedulesConfig.xml on your Manager server, for example:

<scheduleWorkflow workflow="ReclaimDestroyedStaticIPAddresses">

    <recurringSchedule interval="00:05:00"/>

  </scheduleWorkflow>

adjust the interval as you see fit.

YannMichalak
Enthusiast
Enthusiast
Jump to solution

Thx @

You know if the load on Manager server is very most if we set the reclaim IP's itch 5 minutes ?

Reply
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

The DEMs would experience that load. My recommendation is not to change that value. 5 minutes is plenty quick enough. Plus, changes you make to that file will usually get reverted once you go to upgrade.

Reply
0 Kudos
YannMichalak
Enthusiast
Enthusiast
Jump to solution

Yep, sure 5 minutes is clearly perfect, but we don't understand why the reclaim IP process take 30 minutes on our vRA environement 7.3.

Strange because the value in ManagementModelSchedulesConfig.xml is set to :

  <scheduleWorkflow workflow="ReclaimDestroyedStaticIPAddresses">

    <recurringSchedule interval="00:05:00"/>

Detroy deployment > Ip move to DESTROYED > Ip is see as UNLLOCATED after 30 minutes :smileymischief:

Reply
0 Kudos
YannMichalak
Enthusiast
Enthusiast
Jump to solution

Hi @

158136_158136.pngpastedImage_0.png

thx

Reply
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

You can't, they're internal functions.

Reply
0 Kudos
swapsweet
Enthusiast
Enthusiast
Jump to solution

Hi , 

I have a vro workflow to allocate specific ip in vRA network peofile to keep some ips of thet range reserved for some other purpose than vra machines,  how do i  give name also to IP allocation just as an description for which IP to be allocated. For eg during vra provision next to ip colomn vm name comes.. So i want to put that name Manually using vro workfloe

Reply
0 Kudos