Bug 2180281 - [RFE][Machines] Allow to confirm before shut down or reboot a vm
Summary: [RFE][Machines] Allow to confirm before shut down or reboot a vm
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: cockpit-machines
Version: 9.2
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: 9.3
Assignee: Simon Kobyda
QA Contact: Xianghua Chen
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-21 06:08 UTC by Xianghua Chen
Modified: 2023-07-07 09:36 UTC (History)
11 users (show)

Fixed In Version: cockpit-machines-293-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Force shut down (246.78 KB, image/png)
2023-03-21 06:08 UTC, Xianghua Chen
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github cockpit-project cockpit-machines pull 1069 0 None Draft Confirmation dialog for VM shutdown, forceoff, reboot and non-maskable interrupt 2023-05-09 06:21:22 UTC
Red Hat Issue Tracker RHELPLAN-152520 0 None None None 2023-03-21 06:09:04 UTC

Description Xianghua Chen 2023-03-21 06:08:05 UTC
Created attachment 1952264 [details]
Force shut down

Description of problem:
[RFE][Machines] Allow to confirm before shut down or reboot vm (Can provide choice like : "Don't ask again")

This is a requirement from real customer in financial field with RHEL8 system, shutdown by mistake would cause huge problem , a confirmation dialog will lower the risk. 

How reproducible:
100%

Steps to Reproduce:
1. Prepare a running VM
2. Click "Shut down" or "Force shut down" or "Reboot" or "Force reboot"
A confirmation dialog with choice "Don't ask again" is expected.


Actual results:
As above.

Expected results:
As above.

Additional info:
For virt-manager, it has confirmation for "Force shut down" and "Force reboot". Refer to the attachment. Better to have it for shut down and reboot too.

Comment 3 Garrett LeSage 2023-03-27 16:54:41 UTC
I've started the conversation about this on GitHub @ https://github.com/cockpit-project/cockpit-machines/issues/994

Quick summary: The thought right now is to have confirmation prompts for force shutdowns and force reboots, and tie in something called "precious" that prevents deletion to also prompt for normal shutdowns and reboots. It's currently in the discussion phase on how it could be implemented.

Comment 9 Simon Kobyda 2023-05-15 13:28:35 UTC
Upstream PR: https://github.com/cockpit-project/cockpit-machines/pull/1069

Comment 15 Xianghua Chen 2023-07-07 09:19:09 UTC
Verified with packages:
cockpit-machines-293-1.el9.noarch
cockpit-295-1.el9.x86_64
libvirt-dbus-1.4.1-5.el9.x86_64
libvirt-client-9.3.0-2.el9.x86_64

Steps:
1. Prepare a running VM, click "Force shut down"
There is dialog for user to confirm the action:
Force shut down $vm_name?
Uptime 3 minutes

Click "Force shut down", the vm will be closed after confirmation. 
Click "x" or Cancel, the dialog closed without any changes.

2. Run the VM, click "Shut down"
There is dialog for user to confirm the action:
Shut down $vm_name?
Uptime 3 minutes

Click "Shut down", the vm will be closed after confirmation. 
Click "Reboot", the vm will be reboot.
Click "x" or Cancel, the dialog closed without any changes.

3. Keep the VM running, click "Force reboot"
There is dialog for user to confirm the action:
Force reboot $vm_name?
Uptime 3 minutes

Click "Force reboot", the vm should be reboot after confirmation. 
Click "x" or Cancel, the dialog closed without any changes.

4. Keep the VM running, click "Reboot"
There is dialog for user to confirm the action:
Reboot $vm_name?
Uptime 3 minutes

Click "Force reboot", the vm should be reboot after confirmation. 
Click "x" or Cancel, the dialog closed without any changes.

The new feature is available now, but for "Reboot" and "Force reboot", the vm will be reboot immediatedly instead of user click reboot. 
I'll keep this one verified, file new bug for the reboot issue: 
https://bugzilla.redhat.com/show_bug.cgi?id=2221144


Note You need to log in before you can comment on or make changes to this bug.