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
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
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...
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
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
: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.
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.
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.
Thx @daphnissov ......Perfect !
You know if the load on Manager server is very most if we set the reclaim IP's itch 5 minutes ?
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.
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:
You can't, they're internal functions.
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