host and hostname modified by ubuntu cloud images vm installed

hrghope

Member
May 4, 2020
38
0
11
43
my script:
qm destroy 9001
qm create 9001 --name ubuntu-18-cloud-template --sockets 1 --cores 2 --memory 4096 --net0 virtio,bridge=vmbr0 --ostype l26 --sshkey ~/.ssh/id_ed25519.pub
qm importdisk 9001 /root/iso/ubuntu-18.04-server-cloudimg-amd64.qcow2 local-lvm
qm set 9001 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-9001-disk-0 --ide2 local-lvm:cloudinit --boot c --bootdisk scsi0 --serial0 socket --vga serial0


ubuntu-18.04-server-cloudimg-amd64.qcow2 was downloaded from ubuntu official site, it's origin name is ubuntu-18.04-server-cloudimg-amd64.img


after the vm created ,everything is ok。

but when i restarted the pve,i couldn't open the web ui。but i could login in by ssh... but i noticed my host name was ubuntu-18-cloud-template, just like :"root@ubuntu-18-cloud-template",the right should be "root@pve"

i checked system log and found some error,like:

pve_error_1.png
pve_error_2.jpg

i checked the /etc/pve, it's empty。

i googled,and found it was about hostname and hosts. and it was wrong exactly。 so i corrected it,when i resstart pve-cluster
,the web ui looks like ok,but the "ubuntu-18-cloud-template" was a node like my pve node。
when i restarted pve, everything went wrong again。


i tried delete the ubuntu-18-cloud-template vm( by: qm destroy 9001 ) and corrected the host and hostname.

Everything was ok now,even after rebooted pve.


why my cloud guest vm affected the host?it was terrible.

ps:normal ubuntu vm is ok
 
Last edited:
You probably installed cloud-init on your host. After removing it (apt purge cloudinit) you then have to fix your hostname and probably your /etc/hosts and /etc/network/interfaces files.