Score:0

Is there a way to have some default user data/config drive when launching a VM, I.e NOT manually specified by the user?

cn flag

Hi I'm running a private Openstack and I know when we create VM we can pass a config drive to add additional configs to the VM.

But there's some configs we want to standardize across all VMs that users create and not have to rely on user to pass the config drive.

  1. pre-built images that have this config, which relies on someone taking care of building these ISOs.

  2. Have Openstack inject default configs through config drive/userdata/meta data?

I'm hoping #2 exists :)

us flag
If those defaults apply to all VMs, the best option is to add those configs to your golden image(s). Additional user-defined data can be injected via user-data (optionally via config-drive) as you already stated. To create your golden image just boot a VM, make your changes and upload it to the glance store. You don't need to maintain and build ISOs.
cn flag
So no using vendor data or anything like that?
us flag
It really depends on your actualy requirements, you have to decide if you need vendor-data or not. Tbh, I've never used vendor-data, only user-data via metadata service or config-drive, that's sufficient for our use-cases. We create golden images with some default settings (for example having salt-minion enabled, nameservers and what not) so the instances come up with a hostname and IP, and to finish the VM configs we use salt. For provider networks we use config-drive, otherwise the metadata service is sufficient.
Score:0
pe flag

When I create a new image I set this kind of parameters using glance as property value :

 $ glance image-create --name "CentOS 7.9" \
 --file /mnt/backup/centos-7.9-cloud.raw\
 --disk-format raw \ 
 --container-format bare \
 --property hw_scsi_model=virtio-scsi \
 --property hw_disk_bus=scsi \
 --property hw_qemu_guest_agent=yes \
 --property os_require_quiesce=yes \
 --visibility public \
 --progress

In fact, I have problems when instead of creating a VM from an image, I try to generate from a Snapshot. I also tried to add those properties at "flavor" level, but appears it is not working.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.