xenserver disable/enable host report error

Bug #1251943 reported by Guangya Liu (Jay Lau)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Guangya Liu (Jay Lau)

Bug Description

When XenServer disable/enable host, the api set_host_enabled() need to get service info for the target host, but the rpc call of set_host_enabled() did not transfer host as parameter, this will cause the api call failed.

def set_host_enabled(self, host, enabled):
        """Sets the specified host's ability to accept new instances."""
        # Since capabilities are gone, use service table to disable a node
        # in scheduler
        status = {'disabled': not enabled,
                'disabled_reason': 'set by xenapi host_state'
                }
        cntxt = context.get_admin_context()
        service = self._conductor_api.service_get_by_args(
                cntxt,
                host, <<<<<<<<<
                'nova-compute')
        self._conductor_api.service_update(
                cntxt,
                service,
                status)

        args = {"enabled": jsonutils.dumps(enabled)}
        response = call_xenhost(self._session, "set_host_enabled", args)
        return response.get("status", response)

======================================
    def set_host_enabled(self, ctxt, enabled, host):
        cctxt = self.client.prepare(server=host)
        return cctxt.call(ctxt, 'set_host_enabled', enabled=enabled) <<<<<<<<<< No host

Tags: xenserver
Changed in nova:
assignee: nobody → Jay Lau (jay-lau-513)
Matt Riedemann (mriedem)
tags: added: xenserver
Changed in nova:
importance: Undecided → Low
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/56812

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
John Garbutt (johngarbutt) wrote :

This is not in progress

Changed in nova:
status: In Progress → Triaged
Changed in nova:
status: Triaged → In Progress
Changed in nova:
importance: Low → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit f4646b74532d3e75a105290e8333bff92eb838ad
Author: Jay Lau <email address hidden>
Date: Wed Jun 18 09:03:27 2014 -0400

    XenAPI: disable/enable host will be failed when using XenServer

    When disable/enable host with XenServer, the api of set_host_enabled()
    in XenServer driver needs to get service info for the target host, but
    the rpc call of set_host_enabled() did not transfer target host as
    parameter, this will cause the api call failed.

    This patch was let the API of set_host_enabled() use CONF.host.

    Closes-Bug: #1251943

    Change-Id: I2b6427df80ee3188d6f7c4eeb4d2e7be300f0126

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-2 → 2014.2
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.