Create host allows to add any non-existing compute host configured in nova

Bug #1800073 reported by Tushar Patil on 2018-10-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
masakari
Undecided
jayashri bidwe

Bug Description

Create a host using host-create command.

open@open:/opt/stack$ masakari host-create --name non-existing --type compute --segment-id 4163b5e5-87d7-46e5-969e-b1593e05e0e9 --control-attributes testing

Here, I'm passing --name as non-existing.

It creates a host successfully.

Now, check if the hypervisor list returns matching hostname.

open@open:/opt/stack$ nova hypervisor-list --matching non-existing
ERROR (NotFound): No hypervisor matching 'non-existing' could be found. (HTTP 404) (Request-ID: req-49479eb9-cfca-43f2-935f-ddf4eb61ab62)

Actual Result: It create a host in a segment.
Expected Result: It should fail if hypervisor name doesn't match with the name specified in host-create command.

Changed in masakari:
assignee: nobody → jayashri bidwe (jayashrib)

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

Changed in masakari:
status: New → In Progress

Reviewed: https://review.openstack.org/621535
Committed: https://git.openstack.org/cgit/openstack/masakari/commit/?id=b21c763de0fc816df17f5fc1f3a4518672a5ee36
Submitter: Zuul
Branch: master

commit b21c763de0fc816df17f5fc1f3a4518672a5ee36
Author: jayashri bidwe <email address hidden>
Date: Fri Nov 2 18:52:41 2018 +0530

    Allow adding host only if it exists in nova

    Presently, you can add any hostname to the failover segment. It
    doesn't check whether this host exists or not in nova. This patch
    fixes this issue by checking whether the hostname exists in nova or
    not before adding it to the failover segment. If it doesn't exists,
    it will raise 400 error.

    APIImpact
    BadRequest(400) is returned if host doesn't exists in nova instead
    of 200 during host create.

    Closes-Bug: #1800073

    Change-Id: I0ccc9f3a61e3f17f2cb7c1ad1888947c6fe724c8

Changed in masakari:
status: In Progress → Fix Released

This issue was fixed in the openstack/masakari 7.0.0.0b1 development milestone.

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

Other bug subscribers