MAAS fails to use virsh when managing virtual nodes

Bug #1171988 reported by Andres Rodriguez
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
maas (Ubuntu)
Fix Released
High
Unassigned
Raring
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
MAAS fails to start/stop virtual nodes when using virsh. This is because MAAS lacks permissions to run virsh.

[Solution]
The solution is to run virsh with sudo, as well as allowing the 'maas' user to run 'virsh' in the sudoers file.

[Test Case]
To reproduce do the following:

1. install MAAS and configure local KVM nodes with it.
2. Confiugure the power pameters in MAAS.
3. Deploy a node.

Without the fix the node will be never turned on/off and /var/log/maas/maas.log will show:

[Regression Potential]
Minimal. This has been tested in our labs. And this actually fixes something that is currently broken and won't work out of the box. The MAAS team and Server team are dedicated to perform any corrective actions in the events of a regression.

[2013-04-23 11:20:21,482: ERROR/MainProcess] Task provisioningserver.tasks.power_off[926784f3-d90d-4277-bbfc-0471b2c82e80] raised exception: UnpickleableExceptionWrapper('provisioningserver.power.poweraction', 'PowerActionFail', (), 'PowerActionFail()')
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/celery/execute/trace.py", line 181, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/tasks.py", line 146, in power_off
    issue_power_action(power_type, 'off', **kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/tasks.py", line 126, in issue_power_action
    pa.execute(**kwargs)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/power/poweraction.py", line 138, in execute
    self.run_shell(rendered)
  File "/usr/lib/python2.7/dist-packages/provisioningserver/power/poweraction.py", line 126, in run_shell
    raise PowerActionFail(self, e)
PowerActionFail: PowerActionFail()

With the fix, nodes will be turned on/off successfully.

Revision history for this message
Andres Rodriguez (andreserl) wrote :
Changed in maas (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hi, this is missing Regression Potential. Please see https://wiki.ubuntu.com/StableReleaseUpdates#Procedure for more information.

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package maas - 1.3+bzr1461+dfsg-0ubuntu3

---------------
maas (1.3+bzr1461+dfsg-0ubuntu3) saucy; urgency=low

  * debian/patches:
    - 99-fix-ipmi-stat-lp1086160.patch: Drop. The following patch removes
      the need for this fix. (LP: #1171988)
    - 99-fix-ipmi-lp1171418.patch: Do not check current node state when
      executing an ipmi command, which ensures that nodes are always
      turned on/off regardless of their power state. This fixes corner
      cases found when running automated tests. (LP: #1171418)
    - 99-fix-comissioning-lp1131418.patch: Fixes the commissioning process,
      allowing nodes to successfully commission, when tag's with no
      definition have been created. This issue will only appear when these
      special tags are created. (LP: #1131418)
    - 99-import-raring-images-lp1182642.patch: Enables the import of raring
      images by default (LP: #1182642)
    - 99-fix-new-image-install-lp1182646.patch: Fixes the installation of
      new ephemeral images, that fail due to not being able to overwrite
      a symlink. (LP: #1182646)
 -- Andres Rodriguez <email address hidden> Tue, 23 Apr 2013 14:02:33 -0400

Changed in maas (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in maas (Ubuntu Raring):
status: New → Confirmed
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Andres, or anyone else affected,

Accepted maas into raring-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/maas/1.3+bzr1461+dfsg-0ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in maas (Ubuntu Raring):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Andres Rodriguez (andreserl) wrote :

I have tested this and works as expected.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package maas - 1.3+bzr1461+dfsg-0ubuntu2.1

---------------
maas (1.3+bzr1461+dfsg-0ubuntu2.1) raring-proposed; urgency=low

  * debian/patches:
    - 99-fix-ipmi-stat-lp1086160.patch: Drop. The following patch removes
      the need for this fix. (LP: #1171988)
    - 99-fix-ipmi-lp1171418.patch: Do not check current node state when
      executing an ipmi command, which ensures that nodes are always
      turned on/off regardless of their power state. This fixes corner
      cases found when running automated tests. (LP: #1171418)
    - 99-fix-comissioning-lp1131418.patch: Fixes the commissioning process,
      allowing nodes to successfully commission, when tag's with no
      definition have been created. This issue will only appear when these
      special tags are created. (LP: #1131418)
    - 99-import-raring-images-lp1182642.patch: Enables the import of raring
      images by default (LP: #1182642)
    - 99-fix-new-image-install-lp1182646.patch: Fixes the installation of
      new ephemeral images, that fail due to not being able to overwrite
      a symlink. (LP: #1182646)
 -- Andres Rodriguez <email address hidden> Tue, 23 Apr 2013 14:02:33 -0400

Changed in maas (Ubuntu Raring):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.