Chapter 6. Set a Configuration Drive for Instances


You can use the config-drive parameter to present a read-only drive to your instances. This drive can contain selected files that are then accessible to the instance. The configuration drive is attached to the instance at boot, and is presented to the instance as a partition. Configuration drives are useful when combined with cloud-init (for server bootstrapping), and when you want to pass large files to your instances.

6.1. Configuration Drive Options

Use your Compute environment file to set the following configuration drive parameters:

  • config_drive_format - sets the format of the drive, and accepts the options iso9660 and vfat. By default, it uses iso9660.
  • force_config_drive - this forces the configuration drive to be presented to all instances. Set to "True".
  • mkisofs_cmd - specifies the command to use for ISO file creation. This value must not be changed, as only genisoimage is supported.

6.2. Use a Configuration Drive

An instance attaches its configuration drive at boot time. This is enabled by the --config-drive option. For example, this command creates a new instance named test-instance01 and attaches a drive containing a file named /root/user-data.txt:

# nova boot --flavor m1.tiny --config-drive true --file /root/user-data.txt=/root/user-data.txt --image cirros test-instance01

Once the instance has booted, you can log in to it and see a file named /root/user-data.txt.

Note

You can use the configuration drive as a source for cloud-init information. During the initial instance boot, cloud-init can automatically mount the configuration drive and run the setup scripts.

Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.