Can't delete a host using Physical Resource plugin

Bug #1299341 reported by Pablo Andres Fuente
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Fix Released
Medium
Pablo Andres Fuente

Bug Description

When you try to delete a host previously created, you should pass the host_id as a parameter. If you pass the host_id, you get an error when the PR plugin is trying to get the servers of the host that you are trying to delete (https://github.com/stackforge/climate/blob/master/climate/plugins/oshosts/host_plugin.py#L321) because the nova API needs the host name not the host id. If you pass the host_name, you get an error when the PR plugin is trying to get the host from the DB (https://github.com/stackforge/climate/blob/master/climate/plugins/oshosts/host_plugin.py#L325) because you need the host id not the host name.

/opt/stack/climate$ climate --debug host-create my_host
Starting new HTTP connection (1): 10.130.192.41
Starting new HTTP connection (1): 10.130.192.41
Created a new host:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| cpu_info | { |
| | "arch": "x86_64", |
| | "model": "Westmere", |
| | "vendor": "Intel", |
| | "features": [ |
| | "rdtscp", |
| | "x2apic", |
| | "xtpr", |
| | "tm2", |
| | "est", |
| | "vmx", |
| | "ds_cpl", |
| | "monitor", |
| | "pbe", |
| | "tm", |
| | "ht", |
| | "ss", |
| | "acpi", |
| | "ds", |
| | "vme" |
| | ], |
| | "topology": { |
| | "cores": 2, |
| | "threads": 2, |
| | "sockets": 1 |
| | } |
| | } |
| created_at | 2014-03-29 03:39:13.422971 |
| hypervisor_hostname | my_host |
| hypervisor_type | QEMU |
| hypervisor_version | 1000000 |
| id | 1 |
| local_gb | 142 |
| memory_mb | 3655 |
| status | |
| trust_id | eec1ca5b23e244f7b15c39f551f10151 |
| updated_at | |
| vcpus | 4 |
+---------------------+----------------------------------+
/opt/stack/climate$ climate host-delete 1
Starting new HTTP connection (1): 10.130.192.41
Starting new HTTP connection (1): 10.130.192.41
ERROR: Host '1' not found!
/opt/stack/climate$ climate host-delete my_host
Starting new HTTP connection (1): 10.130.192.41
Starting new HTTP connection (1): 10.130.192.41
ERROR: Object with {'host_id': u'my_host'} not found

Revision history for this message
Pablo Andres Fuente (pablo-a-fuente) wrote :

This is my proposal.

Dina Belova (dbelova)
Changed in climate:
assignee: nobody → Pablo Andres Fuente (pablo-a-fuente)
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to climate (master)

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

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

Reviewed: https://review.openstack.org/84182
Committed: https://git.openstack.org/cgit/stackforge/climate/commit/?id=68b0c99a032871c03f4968486040e105167e3c16
Submitter: Jenkins
Branch: master

commit 68b0c99a032871c03f4968486040e105167e3c16
Author: Pablo Andres Fuente <email address hidden>
Date: Mon Mar 31 13:34:54 2014 -0300

    PR plugin uses host name to query Nova inventory

    Use host hypervisor_name instead of host id to query the Nova inventory
    to avoid not found errors.

    Change-Id: I32c3e8e71354f46ac947ecc8ee8b575e29dd23c1
    Closes-Bug: #1299341

Changed in climate:
status: In Progress → Fix Committed
Changed in blazar:
milestone: none → 0.1.1
Changed in blazar:
status: Fix Committed → Fix Released
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.