简体   繁体   中英

Passing parameters to a virtual machine created using qcow2

I am used to creating virtual machines using OVF format for VMware hypervisor. In OVF file, I can add custom XML tags which are made available as parameters to the guest when guest boots up. They are available as a device to the guest and guest software can mount and read the parameters.

Is it possible to do the same using KVM and QCOW2 format?

Openstack provide metadata service. Instances can retrieve user data (passed as the user_data parameter in the API call or by the --user_data flag in the nova boot command) through the metadata service, by making a GET request.

OpenStack can be configured to write metadata to a special configuration drive that will be attached to the instance when it boots. The instance can retrieve any information that would normally be available through the metadata service by mounting this disk and reading files from it. See about config-drive: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/5/html/End_User_Guide/config-drive.html

Without openstack: I found blog post about Creating a cloud-init config disk for non-cloud boots . I didn't test it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM