<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks for info about Xena API abilities. At the moment we ended up with making changed directly to Nova DB
<span id="🙁">🙁</span><br>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Stephen Finucane <stephenfin@redhat.com><br>
<b>Sent:</b> Tuesday, December 7, 2021 12:30 PM<br>
<b>To:</b> Thomas Goirand <zigo@debian.org>; Kamil Madáč <kamil.madac@slovenskoit.sk>; openstack-discuss <openstack-discuss@lists.openstack.org><br>
<b>Subject:</b> Re: [nova] How to update OS-EXT-SRV-ATTR:hostname</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">On Tue, 2021-12-07 at 11:53 +0100, Thomas Goirand wrote:<br>
> On 12/7/21 11:20 AM, Kamil Madáč wrote:<br>
> > Hello,<br>
> > <br>
> > I would like to ask, how to update OS-EXT-SRV-ATTR:hostname via<br>
> > openstack CLI? We changed hostnames on bunch of instances, but metadata<br>
> > service still serves old hostname which causes that every future rebuild<br>
> > of instance reverts hostname (`hostname` command in instance console)<br>
> > back to old one.<br>
> > <br>
> > Kamil Madáč<br>
> > /Slovensko IT a.s./<br>
> <br>
> Looks like what you want to do is disable cloud-init editing of your VM<br>
> hostname. This is done simply by cloud-init to stop doing this. Simply<br>
> edit /etc/cloud/cloud.cfg and set:<br>
> <br>
> preserve_hostname: true<br>
> <br>
> or remove any cloud-init module from the "cloud_init_modules:" list.<br>
> Simply remove the lines containing:<br>
> - set_hostname<br>
> - update_hostname<br>
> - update_etc_hosts<br>
> <br>
> I hope this helps,<br>
> <br>
> Cheers,<br>
> <br>
> Thomas Goirand (zigo)<br>
<br>
To add to this, there's no way to change the hostname embedded in the instance<br>
metadata until Xena, when we added the ability to provide a 'hostname' parameter<br>
when creating, updating or rebuilding servers (microversion 2.90). See [1] and<br>
[2] for more details.<br>
<br>
Stephen<br>
<br>
[1]https://docs.openstack.org/nova/latest/reference/api-microversion-history.html#maximum-in-xena<br>
[2]https://specs.openstack.org/openstack/nova-specs/specs/xena/implemented/configurable-instance-hostnames.html<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>