terraform-metal-vsphere icon indicating copy to clipboard operation
terraform-metal-vsphere copied to clipboard

provisioning error "The resource 'Private Network' is in use."

Open displague opened this issue 3 years ago • 2 comments

In local testing of #34, I ran into this error (which has not cropped up in integration tests). My configuration (terraform.tfvars) is identical to the ones used in the integration tests, although my account has different entitlements than the Terraform testing account.

I'm logging this issue expected that it will come up again, perhaps this is triggered by a race condition.

null_resource.apply_esx_network_config[1] (remote-exec): Successfully created vSwitch  vSwitch1
null_resource.apply_esx_network_config[1] (remote-exec): Successfully created PortGroup  VM Private Net 1
null_resource.apply_esx_network_config[1] (remote-exec): Successfully created PortGroup  Management
null_resource.apply_esx_network_config[1] (remote-exec): Successfully created PortGroup  vMotion
null_resource.apply_esx_network_config[1] (remote-exec): Successfully created PortGroup  vSAN
null_resource.apply_esx_network_config[1] (remote-exec): Successfully created PortGroup  VM Public Net 1
null_resource.apply_esx_network_config[1] (remote-exec): Trying to connect to ESX Host . . .
null_resource.apply_esx_network_config[1] (remote-exec): Connected to ESX Host !
null_resource.apply_esx_network_config[1] (remote-exec): Removing vNic: vmk0
null_resource.apply_esx_network_config[1] (remote-exec): Removing Port Group: VM Network
null_resource.apply_esx_network_config[1] (remote-exec): Removing Port Group: Private Network
null_resource.apply_esx_network_config[1] (remote-exec): Traceback (most recent call last):
null_resource.apply_esx_network_config[1] (remote-exec):   File "/root/bootstrap/esx_host_networking.py", line 474, in <module>
null_resource.apply_esx_network_config[1] (remote-exec):     main()
null_resource.apply_esx_network_config[1] (remote-exec):   File "/root/bootstrap/esx_host_networking.py", line 369, in main
null_resource.apply_esx_network_config[1] (remote-exec):     host_network_system.RemovePortGroup(pgroup[23:])
null_resource.apply_esx_network_config[1] (remote-exec):   File "/usr/local/lib/python3.6/dist-packages/pyVmomi/VmomiSupport.py", line 706, in <lambda>
null_resource.apply_esx_network_config[1] (remote-exec):     self.f(*(self.args + (obj,) + args), **kwargs)
null_resource.apply_esx_network_config[1] (remote-exec):   File "/usr/local/lib/python3.6/dist-packages/pyVmomi/VmomiSupport.py", line 512, in _InvokeMethod
null_resource.apply_esx_network_config[1] (remote-exec):     return self._stub.InvokeMethod(self, info, args)
null_resource.apply_esx_network_config[1] (remote-exec):   File "/usr/local/lib/python3.6/dist-packages/pyVmomi/SoapAdapter.py", line 1397, in InvokeMethod
null_resource.apply_esx_network_config[1] (remote-exec):     raise obj # pylint: disable-msg=E0702
null_resource.apply_esx_network_config[1] (remote-exec): pyVmomi.VmomiSupport.ResourceInUse: (vim.fault.ResourceInUse) {
null_resource.apply_esx_network_config[1] (remote-exec):    dynamicType = <unset>,
null_resource.apply_esx_network_config[1] (remote-exec):    dynamicProperty = (vmodl.DynamicProperty) [],
null_resource.apply_esx_network_config[1] (remote-exec):    msg = "The resource 'Private Network' is in use.",
null_resource.apply_esx_network_config[1] (remote-exec):    faultCause = <unset>,
null_resource.apply_esx_network_config[1] (remote-exec):    faultMessage = (vmodl.LocalizableMessage) [],
null_resource.apply_esx_network_config[1] (remote-exec):    type = vim.host.PortGroup,
null_resource.apply_esx_network_config[1] (remote-exec):    name = 'Private Network'
null_resource.apply_esx_network_config[1] (remote-exec): }

displague avatar Apr 30 '21 17:04 displague