Nova CLI - No message on nova-agent deletion

Bug #1557888 reported by Preeti
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Opinion
Wishlist
Preeti

Bug Description

In Nova, when deleting a nova-agent , no message or alert is generated.
But for other commands eg. nova delete <instance-id>, after deleting an
instance a proper message is generated.

Preeti (pandey-preeti1)
Changed in nova:
assignee: nobody → Preeti (pandey-preeti1)
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

@Preeti:
* What do you mean with "message or alert"? A log entry, a notification, something else?
* Is this related to the XEN driver? That's the only occurrence I found in the current master code.
* In which release (Kilo, Liberty, Mitaka) did you discover this?
* Is this reproducible via the Nova CLI or was this found during code inspection?

Please provide information to the questions above and switch the status then back to "new".

Changed in nova:
status: New → Incomplete
Revision history for this message
Preeti (pandey-preeti1) wrote :

@Markus Zoeller
* With "message or alert" I mean that when the nova agent is deleted , a message should be generated stating " Nova agent has been successfully deleted." or a similar message should be generated.
* I discovered this in Liberty release.
* Using CLI , when I give the command " nova agent-delete <agent_id> this can be reproduced.

Changed in nova:
status: Incomplete → New
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

@Preeti:
Where will I find this message? In the logs? Does the CLI print that to stdout?

Revision history for this message
Preeti (pandey-preeti1) wrote :

@Markus Zoeller
The message must be printed in the CLI after the "nova agent-delete <agent_id>" command is executed as it appears in the CLI when other nova commands are executed. For eg. nova delete <server_id> gives CLI output "Request to delete server <id> has been accepted."

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

OK, got it now, so it's about the feedback of the python-novaclient.
It looks like we have 3 different strategies to provide feedback:

1. Print a message that the task is accepted
2. Print a table with details of the deleted object
3. Print nothing

Feedback 1 is usefull for long running asynchronous tasks like the
creation of instances:

    stack@stack:~$ nova boot --image cirros-0.3.4-x86_64-uec \
    --flavor m1.tiny my-own-instance
    # [... snip instance details ...]
    stack@stack:~$ nova delete my-own-instance
    Request to delete server my-own-instance has been accepted.
    stack@stack:~$

Feeback 2 is used for deleting a flavor:

    stack@stack:~$ nova flavor-create my-own-flavor 12345 512 0 3
    # [... snip flavor details ...]
    stack@stack:~$ nova flavor-delete my-own-flavor
    +-------+---------------+-----------+------+-----------+------+[...]
    | ID | Name | Memory_MB | Disk | Ephemeral | Swap |[...]
    +-------+---------------+-----------+------+-----------+------+[...]
    | 12345 | my-own-flavor | 512 | 0 | 0 | |[...]
    +-------+---------------+-----------+------+-----------+------+[...]
    stack@stack:~$

Feedback 3 is used for deleting an agent (as you find out) and also for
deleting a keypair:

    stack@stack:~$ nova agent-create linux x86 1.0 http://dummy.com \
    0e49760580a20076fbba7b1e3ccd20e2 libvirt
    # [... snip agent details ...]
    stack@stack:~$ nova agent-delete 1
    stack@stack:~$

    stack@stack:~$ nova keypair-add my-own-keypair
    # [... snip keypair details ...]
    stack@stack:~$ nova keypair-delete my-own-keypair
    stack@stack:~$

Incomplete:
I'd say that "nova agent-delete" doesn't fall into the "feedback 1"
category as it isn't a long running task. Because other "nova *-delete"
commands also don't provide feedback, I'm not sure if this is a valid
bug report. I'm going to ask around.

Test Env:
I tested with Nova master (Mitaka cycle), commit 859ff48

affects: nova → python-novaclient
Changed in python-novaclient:
status: New → Incomplete
Revision history for this message
melanie witt (melwitt) wrote :

Alas, the feedback message behavior for different commands is inconsistent. One reason is because of the utils.do_action_on_many function that's used in some commands to enable the command to run in a batch (for example, 'nova delete server1 server2 server3'). The utils.do_action_on_many prints a message to the screen for each resource it acts upon.

I notice some commands arbitrarily have feedback even though they don't run in a batch. Many commands don't have any feedback.

I'm not aware that there has been any strategy around command feedback messages.

There was recently some effort to add the batch ability to more commands with a blueprint [1] and a patch [2] up.

But that got stalled on opposition to the idea of adding more feedback messages without placing them behind a --verbose flag.

The problem is there are already a lot of feedback messages that are not behind a --verbose flag. So we either should put them all behind --verbose flags or just add the new messages as-is. That is, I think it should be consistent.

Either way is not a fun situation IMO because you either have a release where all feedback messages disappear suddenly and need --verbose to get them back or you have new feedback messages unexpectedly showing up for some commands in the release. Or, you can be inconsistent and not have new unexpected printing but new feedback messages go behind --verbose. I just thought it would be confusing if some commands need --verbose to see feedback and some don't.

Thoughts?

[1] https://blueprints.launchpad.net/python-novaclient/+spec/enhance-commands-for-usability
[2] https://review.openstack.org/#/c/190111/

Revision history for this message
Preeti (pandey-preeti1) wrote :

When "nova aggregate-delete <id>" command is executed it gives CLI output "Aggregate <id> has been successfully deleted."
Same happens when "nova server-group-delete <id>" command is executed. For these commands utils.do_action_on_many function is not being used.
Either the CLI output must be printed for all the "nova *-delete" commands ie. aggregate, agents etc. or for none. The feedback generation behaviour should be consistent.

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

@Preeti: If you want to go sure before you start coding, you could ask
on the openstack-dev ML about the desired strategy.
@Melanie: The links you provided in comment #6 left me still a little
clueless if there is consensus about the behavior. IIUC, Sean and Kevin
weren't on the same page for example.

I think we're all on the same page that a consistent behavior is
desirable. Personally, my expectation from CLI clients in terms of
feedback behavior has 4 levels. Let me describe it with pseudo nova
client calls with increasing verbosity:

   nova --quiet <command> # don't tell my *anything*
   nova <command> # show success or failure (one line)
   nova --verbose <command> # show me details of whats happening
   nova --debug <command> # I'm a developer, I need to know *everything*

Personally (again), I see a one line success|failure message not as
verbose. I don't have the bandwidth to do a (probably long) discussion
on the ML to drive to a consensus about a general strategy.

For this specific bug report here I would be fine with adding a one line
message of the "nova *-delete" commands ("nova agent-delete",
"nova keypair-delete" and probably others too) which don't yet output
any message, as this would decrease the inconsistent behavior with
little negative impact.

Changed in python-novaclient:
status: Incomplete → Confirmed
Revision history for this message
melanie witt (melwitt) wrote :

Markus, there isn't consensus about the behavior -- some think a one line feedback is fine, others think there shouldn't be feedback without --verbose. I do like your characterization of the different levels of feedback (--quiet, "normal", --verbose, --debug). I don't have a strong opinion about it so I was hesitant to approve the patch [1] knowing the opposition.

[1] https://review.openstack.org/#/c/190111/

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

Per the delete CLI, "Request to delete server <id> has been accepted." seems fine since it's a 202 response, so the user should probably be aware that something is happening in the background. Otherwise if it's a 200 response, I'd be fine with requiring --verbose for an ack, else you should assume it works if the command exits with a 0 return code.

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

Probably ask the python-openstackclient guys what they do, where this should really probably be moved since the CLI for novaclient is supposed to be deprecated in favor of osc.

Changed in python-novaclient:
status: Confirmed → Opinion
importance: Undecided → Wishlist
Revision history for this message
Augustina Ragwitz (auggy) wrote :

I'm working on a post to the openstack-dev mailing list to further discuss this.

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.