Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 13. Preventing cloud-init from updating config files
When you create or restore an instance from a backup image, the instance ID changes. With an updated instance ID, the cloud-init utility updates configuration files. However, you can ensure that cloud-init does not update certain configuration files when you create or restore from backup.
Procedure
Edit the
/etc/cloud/cloud.cfgfile:# vi /etc/cloud/cloud.cfgComment out or remove the configuration that you do not want
cloud-initto update when you restore your instance. For example, to avoid updating the SSH key file, remove-sshfrom thecloud_init_modulessection.cloud_init_modules: - disk_setup - migrator - bootcmd - write-files - growpart - resizefs - set_hostname - update_hostname - update_etc_hosts - rsyslog - users-groups # - ssh
Verification
To check the configuration files updated by
cloud-init, examine the/var/log/cloud/cloud-init.logfile. Updated files are logged during instance startup with messages beginning withWriting to:2019-09-03 00:16:07,XXX - util.py[DEBUG]: Writing to /root/.ssh/authorized_keys - wb: [XXX] 554 bytes 2019-09-03 00:16:08,XXX - util.py[DEBUG]: Writing to /etc/ssh/sshd_config - wb: [XXX] 3905 bytes