Host FQDN and Hypervisor hostname perceived by libvirt are different on ubuntu22.04 multipass virsh
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Snap |
New
|
Undecided
|
Unassigned |
Bug Description
On host machine(
```
$ multipass get local.driver
libvirt
$ multipass --version
multipass 1.12.2
$ virsh --version
8.0.0
# Use this line to create vm
$ multipass launch -c 4 -m 16G -d 50G https:/
```
Inside multipass sunbeam
```
$ sunbeam cluster bootstrap --accept-defaults
Error: Host FQDN and Hypervisor hostname perceived by libvirt are different, check `hostname -f` and `/etc/hosts` file
$ ip -c a
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,
link/ether 52:54:00:79:8b:41 brd ff:ff:ff:ff:ff:ff
altname enp0s3
inet 10.78.137.122/24 metric 100 brd 10.78.137.255 scope global dynamic ens3
valid_lft 3138sec preferred_lft 3138sec
inet6 fe80::5054:
valid_lft forever preferred_lft forever
$ cat /etc/hosts
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/
#
127.0.1.1 sunbeam sunbeam
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
$ hostname -f
sunbeam
```
Debug
```
>>> from sunbeam import utils
>>> utils.get_
'sunbeam'
>>> utils.get_fqdn()
'sunbeam.multipass'
>>> utils.get_
'10.78.137.122'
>>> socket.
('sunbeam', ['sunbeam'], ['127.0.1.1'])
>>> socket.
('localhost', [], ['127.0.0.1'])
>>> socket.
('sunbeam.
```
@JamesLin
I encountered the same problem. When you change the hostname to something else and re run "sunbeam cluster bootstrap --accept-defaults" it works. Surely this is not an explanation to the bug but it can be assumed as a workaround.
For example: oldopenstacknet work
cat /etc/hostname is: oldone
hostname -f output is: oldone.