Correct the hostname when booting from volume

The hostname of the instance is not set correct when booting from
volume. It's caused by redundant data in network_metadata in
instance_metadata, so the data will be cleaned.

Change-Id: Id6c847cae4442fa70f2de212c22968973f139601
This commit is contained in:
Yi Chun Huang 2017-01-19 14:50:29 +08:00 committed by Huang Rui
parent a7a695cc73
commit 1a9765bf73
1 changed files with 3 additions and 0 deletions

View File

@ -446,6 +446,9 @@ class ZVMDriver(driver.ComputeDriver):
content=injected_files,
extra_md=extra_md,
request_context=context)
# network_metadata will prevent the hostname of the instance from
# being set correctly, so clean the value
inst_md.network_metadata = None
configdrive_tgz = os.path.join(instance_path, 'cfgdrive.tgz')