2

I have an ec2 instance with an ephemeral disk. This instance goes down every night and boots up when needed. I used cloud-init to format the ephemeral disk and this works correct but only once. when this machine is stopped and started (and the ephemeral disk disappears) it no longer runs this cloud-init module. I have attempted to override the default frequency by declaring the module in /etc/cloud/cloud.cfg as

cloud_init_modules:
 - [ disk-setup, always ]

And I have tried changing /usr/lib/python2.7/dist-packages/cloudinit/config/cc_disk_setup.py by changing the following variable

frequency = ALWAYS

Is it possible to force the module to run on every boot or do i need to approach this differently?

kashian
  • 31
  • 1
  • 8

1 Answers1

1

You seem to have a minor typo in module name. This works just fine for me:

cloud_init_modules:
  [disk_setup, always]

Here's a relevant excerpt from the docs:

# cloud_config_modules:
# This is an array of arrays or strings.
# if item is a string, then it is read as a module name
# if the item is an array it is of the form:
#   name, frequency, arguments
# where 'frequency' is one of:
#   once-per-instance
#   always

It seems there's no way to set in module configuration section.

Nikolaj Š.
  • 629
  • 1
  • 5
  • 5