Chapter 10. Setting up container storage by using cloud-init
You can set up storage by referencing the container-storage-setup
utility within the write_files
module.
Prerequisites
Depending on the requirements of your datasource, edit the
user-data
file or add the following directive to thecloud.cfg.d
directory:NoteAll user directives include
#cloud-config
at the top of the file so thatcloud-init
recognizes the file as containing user directives. When you include directives in thecloud.cfg.d
directory, name the file*.cfg
, and always include#cloud-config
at the top of the file.
Procedure
Add or modify the
write_files
module to include the path to thecontainer-storage-setup
utility:write_files: - path: /etc/sysconfig/docker-storage-setup permissions: 0644 owner: root content: | ROOT_SIZE=6G
write_files: - path: /etc/sysconfig/docker-storage-setup permissions: 0644 owner: root content: | ROOT_SIZE=6G
Copy to Clipboard Copied! This example sets the size of the root logical volume to 6 GB rather than the default 3 GB.