I found the root cause, the `required_by` function in `nova.virt.config_drive` module did not take the case as follows into consideration:
"""
def required_by(instance):
image_prop = instance.image_meta.properties.get( "img_config_drive", fields.ConfigDrivePolicy.OPTIONAL)
return (instance.config_drive or CONF.force_config_drive or image_prop == fields.ConfigDrivePolicy.MANDATORY
)
"""
When instances ,initially booted without `--config-drive` option and host `force_config_drive=True` option,
are hard rebooted in host with `force_config_drive=True` newly configured and virt XML needs to be re-generated,
they should not be enforced to have config drives. Only the newly-built ones should be.
I found the root cause, the `required_by` function in `nova.virt. config_ drive` module did not take the case as follows into consideration: by(instance) : image_meta. properties. get(
"img_config_ drive",
fields. ConfigDrivePoli cy.OPTIONAL)
"""
def required_
image_prop = instance.
return (instance. config_ drive or
CONF. force_config_ drive or
image_ prop == fields. ConfigDrivePoli cy.MANDATORY config_ drive=True` option, config_ drive=True` newly configured and virt XML needs to be re-generated,
)
"""
When instances ,initially booted without `--config-drive` option and host `force_
are hard rebooted in host with `force_
they should not be enforced to have config drives. Only the newly-built ones should be.