Closed sbeyermann closed 1 year ago
@sbeyermann, sorry for a pretty late response. In order to perform a "Power Off (Grafeful)" operation on a server, you will have to set the power_state
to off
instead of shutdown
.
In ome_powerstate.py file, I see the following mapping of the power_state values to the internal codes that OME uses for device power actions. The "Power Off (Graceful)" device action maps 12
internally, so you will have to set power_state: "off"
in your playbook.
VALID_OPERATION = {"on": 2, "off": 12, "coldboot": 5, "warmboot": 10, "shutdown": 8}
@anupamaloke, thank you for your response. It took a while, but now I managed to test your explanation in my playbook. Indeed, setting the power_state
to off
gracefully shuts down the server.
It would be really great if you could add the expected action to the dellemc.openmanage.ome_powerstate module
documentation.
Thank you for your help!
Bug Description
I use a very simple task to shut down a server using the
dellemc.openmanage.ome_powerstate
module:From the documentation I would assume that setting
power_state
toshutdown
would initiate a graceful shutdown of the operating system. However in our environment that does not seem to be the case.Running the above task translates to the following job in Dell OpenManage Enterprise
As you can see OME performs a POWER_OFF_SOFT on the device, which then translates to the following in the iDRAC lifecycle protocol (newer entries first)
For me this looks like a simple turning off of the system and no clean and graceful shutdown.
On the operating system side the above behavior leads to the "System unexpectedly shutdown (event id 600)" events on Microsoft Windows Operating Systems and to ext4 file system checks on Linux operating systems.
Component or Module Name
dellemc.openmanage.ome_powerstate
Ansible Version
Ansible 2.15.1
Python Version
3.11.2
iDRAC/OME/OME-M version
Operating System
Debian 11 (Bullseye) Windows Server 2022
Playbook Used
Logs
Steps to Reproduce
This is no intermittent issue. It happens every time I execute the above playbook/task and it happens on both operating systems (Windows Server 2022 and Debian 11) that I tested.
Expected Behavior
I would expect the operating system to shutdown graceful (stopping all services, unmounting filesystems, etc.) and then the server to turn off.
Actual Behavior
The server just get powered off, without a graceful shutdown of the running operating system (like someone pressing the power button for three seconds).
Screenshots
No response
Additional Information
No response