[Openstack] reboot/shutdown in cloud-init script

Lars Kellogg-Stedman lars at redhat.com
Mon Feb 23 14:37:32 UTC 2015


On Thu, Feb 19, 2015 at 09:33:36AM -0700, Grant Schoep wrote:
> page. File contents are
> power_state:
>  delay: "+30"
>  mode: poweroff
>  message: Bye Bye
>  timeout: 30
> 
> It doesn't work,  I noticed this line in my /var/log/cloud-init-output.log
> 
> __init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart)
> userdata: 'power_state:\n delay: "+3...'

Any user-data script to be handled by cloud-init needs to specify a
"content type" as the first line of a script.  For a cloud-config
file, like you're using, you would need to start with '#cloud-config',
like this:

    #cloud-config

    power_state:
     delay: "+30"
     mode: poweroff
     message: Bye Bye
     timeout: 30

-- 
Lars Kellogg-Stedman <lars at redhat.com> | larsks @ {freenode,twitter,github}
Cloud Engineering / OpenStack          | http://blog.oddbit.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20150223/f4ab73c0/attachment.sig>


More information about the Openstack mailing list