Bug 2180281

Summary: [RFE][Machines] Allow to confirm before shut down or reboot a vm
Product: Red Hat Enterprise Linux 9 Reporter: Xianghua Chen <xchen>
Component: cockpit-machinesAssignee: Nobody <nobody>
Status: CLOSED ERRATA QA Contact: Xianghua Chen <xchen>
Severity: high Docs Contact:
Priority: medium    
Version: 9.2CC: bcao, glesage, kkoukiou, mmarusak, mpitt, qzhang, sbarcomb, wshi, ymao, yunyang
Target Milestone: rcKeywords: CustomerScenariosInitiative, FutureFeature, Triaged
Target Release: 9.3Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: cockpit-machines-293-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:24:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Force shut down none

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

Comment 18 errata-xmlrpc 2023-11-07 08:24:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (cockpit-machines bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6336