Closed cjoelrun closed 10 years ago
Closing. Can't reproduce now. Reopen if necessary for 4.2.3.
I am going to reopen this for 4.2.2
we need to default this to -2 to disable file injection. This can be done with cloud-init instead of cracking open the image. https://github.com/rcbops-cookbooks/nova/blob/master/attributes/default.rb#L127
@klevenstein doc impact on this one for 4.2.2
Fixed in master: https://github.com/rcbops-cookbooks/nova/pull/395 Going into 4.2.2: https://github.com/rcbops-cookbooks/nova/pull/396
This is not fixed with cloud-init. The EC2 provider does not support file injection of the OpenStack kind (--file).
The most sane way to do file injection is using a config drive instead of metadata.
nova boot --config_drive=true --file /root/openrc=/root/openrc --flavor 1 --image cirros-image
Reopening this so that the workaround/best practice is documented.
--file in the nova cli and API is a OpenStack specific feature.
File injections work in one of three ways:
1) guestfs launches a VM with the instance and uses a communication path to copy the file to the instance. The instance is then stopped, and OpenStack starts a new one kvm process with the modified image file. 2) use cloud-init and config-drive to copy the file into the image. 3) user-data can be specified at instance invocation to supply a bash script that writes the file to the disk.
We feel that launching, copying, tearing down, and relaunching the instance increases the overhead on the hypervisor and can be prone to failure.
cloud-init can copy this file over correctly when using config-drive (or user-data).
We recommend using config-drive and cloud-init to copy files to the instance. This is supported on both RedHat, Ubuntu, cirros, and Windows (third party cloud-init). You can enforce the use of config-drive by setting the following override attribute:
"nova": {
"config":
"force_config_drive": true
}
}
if this is a thing we're never going to fix, would it make more sense to put it in the actual install guide, rather than in the release notes?
@klevenstein yes - but I think a short note in the release notes to define the change in behavior is still a good idea.
How does this sound:
File injection best practice When file injection is needed, Rackspace recommends using config-drive and cloud-init to copy files to an instance. When performed manually, set the --config-drive attribute to true in the nova boot command, as in the following example.
$ nova boot --config_drive=true --file /root/openrc=/root/openrc --flavor 1 --image cirros-image
You can also set an override attribute in your environment that enforces the use of config-drive at all times.
"nova": {
"config":
"force_config_drive": true
}
}
@klevenstein Close, but the paragraph shouldn't say "using config-drive and cloud-init to copy files", because this suggestion is to config-drive to do the file copying. cloud-init won't be in use when config-drive is enabled, so this bit of documentation is contrasting to the usual case of cloud-init.
Ah, okay. So instead: "When file injection is needed, Rackspace recommends using config-drive to copy files to an instance."
Yep, +1 from me. @rackerjoe?
@klevenstein go with your original statement. cloud-init uses config-drive to present and copy the files to the instance.
@rackerjoe how about "Rackspace recommends enabling config-drive so that cloud-init can copy files to an instance"? If that's the accurate description of what's going on here.
@klevenstein That sounds good.
Added to release notes and instructions for instance creation in the Install/Getting Started guide.
QE Verified. Looks good
Nova can't boot an instance with file injection . Seen on precise