New Question
0

Hostname changes using metadata

asked 2020-07-20 17:36:01 +0300

anonymous user

Anonymous

Hello, I have a VM created from OpenStack. I'm sending "hostname" metadata value to the VM and the password. Password is kept as I sent in metadata. But Hostname is always overwritten by the instance-name of the VM.

Is there a way to keep cloud-init using only metadata info and not others?

Useful information

  • Tested on Windows 2012, Windows 2016 and Windows 2019
  • OpenStack Train version

cloudbase-init.conf -> https://pastebin.pl/view/8ef83fcf

cloudbase-init-unattend.conf -> https://pastebin.pl/view/d6a37efe

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2020-07-21 11:34:23 +0300

avladu gravatar image

updated 2020-07-22 09:26:40 +0300

Hello,

If you want cloudbase-init to not set the hostname to the instance name, you should remove the HostnamePlugin from enabled plugins.

What do you mean by "I'm sending "hostname" metadata value to the VM and the password."?

AFAIK when you boot an instance using nova boot (nova boot --meta admin_pass="<password>") only the password is visible in the guest metadata.

UPDATE: all the meta tags sent from "nova boot" are present in the guest metadata.

edit flag offensive delete link more

Comments

Well, I was sending hostname as a meta for the instance, I'd like cloudbase to change the hostname during the first boot here's my meta_data.json for the VM https://pastebin.pl/view/448a6ebc

fgonzales gravatar imagefgonzales ( 2020-07-21 20:38:40 +0300 )edit

the VM name is not being set up as the one I defined in "meta" tag, it's using the "name" which is the instance name for openstack.

fgonzales gravatar imagefgonzales ( 2020-07-21 20:39:15 +0300 )edit

The link you posted does not work, can you share the metadata on pastebin.com ?

avladu gravatar imageavladu ( 2020-07-21 22:42:36 +0300 )edit

The link is working now. As you can set arbitrary meta entries in the metadata, this cannot be implemented in a safe manner for OpenStack. In other words, this desired feature is a custom feature and can be implemented on request (see https://cloudbase.it/about/#contact )

avladu gravatar imageavladu ( 2020-07-21 23:06:52 +0300 )edit

thanks for your comment. I could see into cloudbase-init this log Plugin "SetHostNamePlugin" execution already done cloudinit Meta data works for password, but it doesn't work for hostname

fgonzales gravatar imagefgonzales ( 2020-07-21 23:46:59 +0300 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-07-20 17:36:01 +0300

Seen: 715 times

Last updated: Jul 22 '20