Comment 6 for bug 2009209

Revision history for this message
Ioanna Alifieraki (joalif) wrote :

I have an environment setup (thanks to victorvavan) where I can reproduce the issue.
When installing maas via snap, even if you 'apt install python3-novaclient' the problem
won't go away because of snap confinement, in practice maas cannot see the installed package.

I've installed maas via debs. If the python3-novaclient is present, the message
"Power control software is missing from the rack controller 'maas.maas'. To proceed, install the python3-novaclient package."
goes away but it still fails.

It turns out that, maas openstack driver was written a while back and the novaclient api has changed.
The problem is in this line :
https://git.launchpad.net/maas/tree/src/provisioningserver/drivers/power/nova.py?h=3.1#n81
nova.authenticate()
This method has been deprecated.

The authentication will happen automatically at the first call to the server, but the call
to the novaclient.Client() need to be modified like this:

diff --git a/src/provisioningserver/drivers/power/nova.py b/src/provisioningserver/drivers/power/nova.py
index 039195317..12934947c 100644
--- a/src/provisioningserver/drivers/power/nova.py
+++ b/src/provisioningserver/drivers/power/nova.py
@@ -73,7 +73,7 @@ class NovaPowerDriver(PowerDriver):
         if not self.try_novaapi_import():
             raise PowerToolError("Missing the python3-novaclient package.")
         nova = self.nova_api.Client(
- 2, os_username, os_password, os_tenantname, os_authurl
+ version="2", username="os_username", password="os_password", project_id=os_tenantname, auth_url=os_authurl, user_domain_name=<user-domain-name>
         )

Hardcoding the the user_domain_name for my environment, the "check power" does not throw errors.

At this point, I see 2 problems:

1. Authentication related
To authenticate we need the user_domain_name. I am not an openstack expert and I'm not sure if we can avoid it, but if we can't
that would imply further changes to maas (and maas ui) for the user to provide the user_domain_name.

2. Commissioning
Even if we go past the power on errors, when it gets to the commissioning stage it seems it gets stuck.