Disabled Reason column becomes empty after update host is disabled

Bug #1251803 reported by Guangya Liu (Jay Lau)
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Vladik Romanovsky

Bug Description

liugya@liugya-ubuntu:~$ nova host-update --status disable liugya-ubuntu

liugya@liugya-ubuntu:~$ nova service-list
/usr/lib/python2.7/dist-packages/gobject/constants.py:24: Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed
  import gobject._gobject
+------------------+---------------+----------+----------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+---------------+----------+----------+-------+----------------------------+-----------------+
| nova-conductor | liugya-ubuntu | internal | enabled | up | 2013-11-16T03:06:33.000000 | None |
| nova-compute | liugya-ubuntu | nova | disabled | up | 2013-11-16T03:06:29.000000 | | <<<<<<< Reason is empty now
| nova-cert | liugya-ubuntu | internal | enabled | up | 2013-11-16T03:06:34.000000 | None |
| nova-network | liugya-ubuntu | internal | enabled | up | 2013-11-16T03:06:26.000000 | None |
| nova-scheduler | liugya-ubuntu | internal | enabled | up | 2013-11-16T03:06:31.000000 | None |
| nova-consoleauth | liugya-ubuntu | internal | enabled | up | 2013-11-16T03:06:32.000000 | None |
+------------------+---------------+----------+----------+-------+----------------------------+-----------------+

Tags: libvirt
Changed in nova:
assignee: nobody → Jay Lau (jay-lau-513)
Maithem (maithem)
summary: - Disable reson become empty when update host as disabled
+ Disabled Reason column becomes empty after update host is disabled
Revision history for this message
Guangya Liu (Jay Lau) (jay-lau-513) wrote :

Also, when I disable a service without reason, the service disable reason is always AUTO:

jay@jay1:~/devstack$ nova service-list
+------------------+------+----------+----------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+------+----------+----------+-------+----------------------------+-----------------+
| nova-conductor | jay1 | internal | enabled | up | 2013-12-04T13:41:43.000000 | None |
| nova-cert | jay1 | internal | enabled | up | 2013-12-04T13:41:45.000000 | None |
| nova-scheduler | jay1 | internal | enabled | up | 2013-12-04T13:41:48.000000 | None |
| nova-compute | jay1 | nova | disabled | up | 2013-12-04T13:41:48.000000 | AUTO: |
| nova-consoleauth | jay1 | internal | enabled | up | 2013-12-04T13:41:43.000000 | None |
+------------------+------+----------+----------+-------+----------------------------+-----------------+

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/59998

Changed in nova:
status: New → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :

Is there going to be a separate bug for the disabled reason going to 'AUTO:' if not specified?

tags: added: libvirt
Revision history for this message
Matt Riedemann (mriedem) wrote :

Do you know if this impacts any other virt drivers?

Changed in nova:
importance: Undecided → Low
Revision history for this message
Vladik Romanovsky (vladik-romanovsky) wrote :

The problem is that nova host-update --status disable is being translated to set_host_enabled() which doesn't accept a disable reason.

What you should be using is service-disable --reason which will translate to service_update() and will set the reason.

Your call is currently executing a libvirt method that should be really internal IMHO.

Revision history for this message
Guangya Liu (Jay Lau) (jay-lau-513) wrote :

@Matt, a bug was filed to trace "AUTO:" issue, please refer to https://bugs.launchpad.net/nova/+bug/1259535

This will not impact other virt drivers

Revision history for this message
Guangya Liu (Jay Lau) (jay-lau-513) wrote :

@Vladik, we have two ways to disable a nova-compute service.
1) nova service-update
2) nova host-update

Actually, I was a bit confused by this, I think that we can remove "set_host_enabled" as it is doing same work as service update. Perhaps we need more discussion on dev list. Thanks.

Revision history for this message
Vladik Romanovsky (vladik-romanovsky) wrote :

Jay,

set_host_enabled, which is being called by nova host-update is needed to be implemented when the driver need to perform operations on enable/disable request, while service_update just disables the compute service.

set_host_enabled wasn't implement in the libvirt driver and was introduced to solve the auto disable/re-enable issue.
However, it should have been private.

I think you are right and we do need to discuss
1) nova service-update
2) nova host-update
and make nova host-update to set a reason.

However, at the moment, the auto disable (set_host_enabled) method should be private.

Revision history for this message
Guangya Liu (Jay Lau) (jay-lau-513) wrote :

Vladik,

Yes, I get your point. But as set_host_enabled is a method derived from nova/virt/driver.py and each driver is implementing this method with its own logic. Especially for Xen API, as it need to interact with XenServer to set host status.

Thanks.

Revision history for this message
Vladik Romanovsky (vladik-romanovsky) wrote :

Jay,

Well, Xen driver is implemented in nova/virt/xenapi/driver.py
The proposed patch is not affecting xenserver in anyway.
It is only fixing the method that is currently in libvirt, which shouldn't be public.

Before the following patch libvirt driver didn't have an implementation for set_host_enabled and the only way to disable the service was done using nova service-update not nova host-update, which would result in an error:
https://review.openstack.org/#/c/52189/

If your concern is that the libvirt driver wont have set_host_enabled method, we can add it in another patch, but i'm not sure if it's needed because there are no driver specific operations that should be done in order to disable a service.

Vladik

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/59998
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7265471a229d9bdf2ecdb6d52d6d3f142b1100b3
Submitter: Jenkins
Branch: master

commit 7265471a229d9bdf2ecdb6d52d6d3f142b1100b3
Author: Jay Lau <email address hidden>
Date: Tue Dec 24 13:20:13 2013 +0800

    libvirt: Set "Disabled Reason" to None when enable nova compute

    When use "nova host-update" to enable nova compute, the column of
    "Disabled Reason" will be set as empty, this will make the
    "Disabled Reason" is not consistent with other services.

    +------------------+------+----------+---------+-----------------+
    | Binary | Host | Zone | ... | Disabled Reason |
    +------------------+------+----------+---------+-----------------+
    | nova-conductor | jay1 | internal | ... | None |
    | nova-cert | jay1 | internal | ... | None |
    | nova-scheduler | jay1 | internal | ... | None |
    | nova-compute | jay1 | nova | ... | |
    | nova-consoleauth | jay1 | internal | ... | None |
    +------------------+------+----------+---------+-----------------+

    The fix was set the "Disabled Reason" to None when enable a nova
    compute.

    Change-Id: Ief1f21ba450812a240d30104624bcec92e3f989e
    Partial-Bug: #1251803

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
assignee: Jay Lau (jay-lau-513) → Vladik Romanovsky (vladik-romanovsky)
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/61016
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e1fdd8f9b1536c75e36dd74416dd3aad1495e203
Submitter: Jenkins
Branch: master

commit e1fdd8f9b1536c75e36dd74416dd3aad1495e203
Author: Vladik Romanovsky <email address hidden>
Date: Mon Dec 9 15:54:50 2013 -0500

    libvirt: making set_host_enabled to be a private methods

    Currently _set_host_enabled() is being used only for internal libvirt
    driver purposes, which doesn't correlate to set_host_enabled in the
    compute API.

    _set_host_enabled in the driver is disabling and re-enabling
    the compute service automatically and shouldn't be exposed to the users.

    Also, adding disable_reason as an optional variable and enabled variable
    to be boolean only.

    Change-Id: I5fd13ef352fcbb4a1c96764a9e473cdaf7b128da
    Closes-Bug: #1251803

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-3
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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