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

Bug #1800073 reported by Tushar Patil
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
masakari
Fix Released
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)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to masakari (master)

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

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

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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/masakari 7.0.0.0b1

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

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :

I think this wasn't a bug, but a feature.

Like in hypervisor list we do have hostname like `compute01.domain.com`, but in nova compute service list this compute node is marked as `compute01` - which is eventually correct hostname of this node. it's added to corosync that way, to nova and was to masakari until this patch.

So like after upgrade we're not able to add hosts to masakari because of this "fix"... So I can propose a patch, but would love to discuss with someone how do you see this situation.

Revision history for this message
Tushar Patil (tpatil) wrote :

Dmitriy:

There is a patch[1] which can fix the issue you have mentioned above in comment #4.
Can you please add your views on this patch? We can discuss about it in the upcoming bi-weekly IRC meeting on 19th May.

[1] : https://review.opendev.org/#/c/675734

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.