I have a CentOS VM that need to be used with `cloudinit`.
Using
I have an ansible file that create a VM name
user-data and meta-data are already created.
I previously posted a question on how to convert the
The above commands do create the QEMU VM, I can connect to it from the GUI.
But the CD-ROM ISO with cloud-init config I've created doesn't seems to work, when I try to connect with the user and password from the user-data yaml file. I get that the message from
I tried to remove the cloud init iso, and create a cloud init drive.
When I connect to the VM, I have the same problem:
The CentOS_Base.qcow2 is created by:
Using
libvirt
, I am creating VM on Proxmox with Scaleway.I have an ansible file that create a VM name
CentOS_Base
, the most important commands are:
Bash:
# Downloading a CentOS-7-x86_64-GenericCloud-1809.qcow2
curl https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1809.qcow2
# Create root disk based on cloud init img
qemu-img create -b CentOS-7-x86_64-GenericCloud.qcow2 -f qcow2 -F qcow2 CentOS_Base.qcow2 20G
# Create iso image for cloud init
genisoimage -output cidata.iso -volid cidata -joliet -r user-data meta-data
# Create the VM
virt-install --connect qemu:///system --import --name CentOS_Base --ram 2048 --vcpus 2
--disk CentOS_Base.qcow2,format=qcow2,bus=virtio --disk cidata.iso,device=cdrom
--network network:default,model=virtio --os-type=linux --os-variant=rhel7 --noautoconsole
user-data and meta-data are already created.
I previously posted a question on how to convert the
libvirt
VM to QEMU
, because Proxmox GUI doesn't handle libvirt virtual machine.
Bash:
qm create 9007 --name CentOS-vm1 --memory 2048 --net0 virtio,bridge=vmbr1 --serial0 socket --vga serial0 -ostype l26 -sockets 1 -cores 2 -cpu host -numa 1 -ide2 GlusterFs:iso/cidata.iso
qm importdisk 9007 CentOS_Base.qcow2 GlusterFs -format qcow2
qm set 9007 --scsi0 GlusterFs:9007/vm-9007-disk-0.qcow2 --scsihw virtio-scsi-pci
qm set 9007 --boot order=scsi0
qm resize 9007 scsi0 32G
The above commands do create the QEMU VM, I can connect to it from the GUI.
But the CD-ROM ISO with cloud-init config I've created doesn't seems to work, when I try to connect with the user and password from the user-data yaml file. I get that the message from
Login incorrect
I tried to remove the cloud init iso, and create a cloud init drive.
Bash:
qm create 9007 --name CentOS-vm1 --memory 2048 --net0 virtio,bridge=vmbr1 --serial0 socket --vga serial0 -ostype l26 -sockets 1 -cores 2 -cpu host -numa 1
qm importdisk 9007 CentOS_Base.qcow2 GlusterFs -format qcow2
qm set 9007 --scsi0 GlusterFs:9007/vm-9007-disk-0.qcow2 --scsihw virtio-scsi-pci
qm set 9007 --boot order=scsi0
qm resize 9007 scsi0 32G
qm set 9007 --ide0 GlusterFs:cloudinit
qm set 9007 --ciuser hamuto --cipassword root --sshkeys ~/.ssh/id_rsa.pub
When I connect to the VM, I have the same problem:
Login incorrect
.The CentOS_Base.qcow2 is created by:
wget -O CentOS_Base.qcow2 https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1809.qcow2