grycap / im

Infrastructure Manager
https://www.grycap.upv.es/im
GNU General Public License v3.0
63 stars 21 forks source link

OpenStack_2_NodeDriver object has no attribute 'get_floating_ip' #957

Closed nakos closed 4 years ago

nakos commented 4 years ago

Hi all,

I'm using the IM docker image v1.8.5 to deploy and manage VMs to OpenStack endpoints in the EGI Fedcloud infrastructure with OIDC authentication. Although most actions (deployment,stop,start etc) work as expected, the following error occurs when I'm trying to remove the public IP from a running VM:

ERROR - Inf ID: f1154534-1b73-11ea-97df-0242ac110002: Error adding/removing new public IP
Traceback (most recent call last):
 File "/usr/local/lib/python2.7/dist-packages/IM/connectors/OpenStack.py", line 1553, in alter_public_ips
   floating_ip = node.driver.get_floating_ip(current_public_ip)
AttributeError: 'OpenStack_2_NodeDriver' object has no attribute 'get_floating_ip'
2019-12-11 12:39:37,315 - InfrastructureManager - ERROR - Error modifying resources
Traceback (most recent call last):
 File "/usr/local/lib/python2.7/dist-packages/IM/REST.py", line 799, in RESTAlterVM
   vm_info = InfrastructureManager.AlterVM(infid, vmid, radl_data, auth)
 File "/usr/local/lib/python2.7/dist-packages/IM/InfrastructureManager.py", line 812, in AlterVM
   raise Exception("Error modifying the information about the VM %s: %s" % (vm_id, alter_res))
Exception: Error modifying the information about the VM 0: Error adding/removing new public IP: 'OpenStack_2_NodeDriver' object has no attribute 'get_floating_ip'

The exception seems to originate here

The authentication parameters were set as indicated in the documentation for the EGI Fedcloud case.

micafer commented 4 years ago

Hi @nakos,

It is just a "typo" the correct function name is "ex_get_floating_ip". Could you test it please?

Thanks

nakos commented 4 years ago

Hi @micafer,

Thank you, I tested it to some sites and no error occurred.

However, when the public IP is indeed removed (can no longer connect via ssh or ping it), the IM still returns the "net_interface.0.ip" and "net_interface.0.connection" with the previous values when retrieving the VM info.

I'm using the rest endpoint /infrastructures/infrid/vms/vmid to get the VM info.

micafer commented 4 years ago

Hi @nakos,

I get the problem. I added two commits to correctly fix it.

nakos commented 4 years ago

Thank you @micafer, it works great now.