RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1252477 - power_state_change module not enabled by default
Summary: power_state_change module not enabled by default
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cloud-init
Version: 7.4
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: rc
: 7.4
Assignee: Lars Kellogg-Stedman
QA Contact: Vratislav Hutsky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-11 14:08 UTC by Jaroslav Henner
Modified: 2024-11-21 02:56 UTC (History)
4 users (show)

Fixed In Version: cloud-init-0.7.9-6.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 23:23:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:2275 0 normal SHIPPED_LIVE new packages: cloud-init 2017-08-01 19:44:55 UTC

Description Jaroslav Henner 2015-08-11 14:08:56 UTC
Description of problem:
Cloud-init doesn't have the power_state_change module enabled by default. That causes that it is cumbersome to reboot the VM after some changes were applied by cloud-init.

This can be workarounded by enabling it on-demand, but then all the modules required have to be specified in the cloud-config, which is quite inconvenient:

#cloud-config
cloud_final_modules:
 - rightscale_userdata
 - scripts-per-once
 - scripts-per-boot
 - scripts-per-instance
 - scripts-user
 - ssh-authkey-fingerprints
 - keys-to-console
 - phone-home
 - final-message
 - power_state_change
power_state:
 delay: "now"
 mode: reboot
 message: Rebooting due to atomic host update was performed
 timeout: 30
the fix is to make sure that this module is in the cloud-init defaults (/etc/cloud/cloud.cfg).

---8<---8<---8<---8<
...
cloud_final_modules:
 - rightscale_userdata
 - scripts-per-once
 - scripts-per-boot
 - scripts-per-instance
 - scripts-user
 - ssh-authkey-fingerprints
 - keys-to-console
 - phone-home
 - final-message
 - power_state_change
...
---8<---8<---8<---8<

Version-Release number of selected component (if applicable):
cloud-init 0.7.6


How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 5 Vratislav Hutsky 2017-07-20 13:04:59 UTC
Verified on RHEL 7.4 Release Candidate in AWS (ami-3d6ecc52 in the eu-central-1 region). 

# rpm -iq cloud-init
cloud-init-0.7.9-9.el7.x86_64


# cat /etc/cloud/cloud.cfg
...
cloud_final_modules:
 - rightscale_userdata
 - scripts-per-once
 - scripts-per-boot
 - scripts-per-instance
 - scripts-user
 - ssh-authkey-fingerprints
 - keys-to-console
 - phone-home
 - final-message
 - power-state-change
...
(I omitted parts of /etc/cloud/cloud.cfg)




When I starting a machine with this user data:

#cloud-config
power_state:
 delay: "now"
 mode: poweroff
 message: Stopping the machine
 timeout: 30


the machine was stopped indeed and the /var/log/cloud-init.log contained the following lines:

2017-07-20 12:29:50,366 - cc_power_state_change.py[DEBUG]: After pid 1325 ends, will execute: shutdown -P now Stopping the machine
2017-07-20 12:29:50,368 - handlers.py[DEBUG]: finish: modules-final/config-power-state-change: SUCCESS: config-power-state-change ran successfully

Comment 6 errata-xmlrpc 2017-08-01 23:23:42 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, 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/RHEA-2017:2275


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