Moving from CentOS 7 to Proxmox

simon_lefisch

Member
Jun 20, 2022
14
1
8
Hello everyone,

I posted something similar about this a year or so ago. However now my CentOS 7 box is EOl and I need to move to a different hypervisor. Proxmox is my obvious choice, but I am having some issues with importing my VMs. Here is an explanation....

I am currently running Proxmox on my MacBook Pro just so I can get used to the procedure of importing VMs. Some of the VMs are in qcow2 format and others are in .img format. Also, some were created with regular BIOS and others with UEFI. The ones BIOS were created prior to me adding the q35 package in CentOS.

So here is my issue.....I pulled one of the VMs that is UEFI and has a disk image of qcow2, I also pulled the corresponding XML file just in case. When I configured my Proxmox VM, I chose a mirrored ZFS RAID (VM drives are 80GB, the VM from my CentOS box is only 40GB). I created a new VM in Proxmox with UEFI, the HD bus is VirtIO (that's what was configured in the XML), and gave it 2 vCPUs and 2GB RAM (it's a Linux VM). I then removed drive and imported the original using the qm disk import command (see below)

Code:
qm disk import 100 <source_of_drive_file> <local_storage>

The import complete, however the VM did not boot. I received the error below:

Screenshot 2024-08-14 at 10.41.40.png

When I switched the BIOS to SeaBIOS, I received the error below:

Screenshot 2024-08-14 at 10.42.41.png

I even removed the EFI disk from the VM and still received similar errors, one of them starting a shell.

When I tried to re-import the .qcow2 file using the above command but adding the --format qcow2 option, I received a message stating the .qcow2 is not a supported format in ZFS.

So I am at a bit of a loss of what to do. I'd like to move everything over to Proxmox sooner than later but I need some guidance as to what the correct procedure is so I can boot my VMs. Hopefully someone can give me insight as to what I did wrong.

Also, below is the XML of the VM from my CentOS 7 box. Maybe it'll give someone some info as to what I need to do to get the VM to boot up. TIA

Code:
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit dnsserver-vm
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>dnsserver-vm</name>
  <uuid>6bc09905-f5d9-48a8-ba1a-288ac1ca6299</uuid>
  <title>LAN: DNS Server</title>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc-q35-rhel7.6.0'>hvm</type>
    <loader readonly='yes' secure='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.secboot.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/dnsserver-vm_VARS.fd</nvram>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <vmport state='off'/>
    <smm state='on'/>
  </features>
  <cpu mode='host-passthrough' check='none'>
    <topology sockets='2' cores='1' threads='1'/>
  </cpu>
  <clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled='no'/>
    <suspend-to-disk enabled='no'/>
  </pm>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none' io='native'/>
      <source file='/mnt/kvm/images/dnsserver-vm.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <boot order='2'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='1' port='0x10'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='2' port='0x11'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='3' port='0x12'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='4' port='0x13'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
      <model name='pcie-root-port'/>
      <target chassis='5' port='0x14'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:a9:43:de'/>
      <source network='ovs-network'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes'>
      <listen type='address'/>
      <image compression='off'/>
    </graphics>
    <video>
      <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </video>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='1'/>
    </redirdev>
    <redirdev bus='usb' type='spicevmc'>
      <address type='usb' bus='0' port='2'/>
    </redirdev>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </memballoon>
  </devices>
</domain>
 
<nvram>/var/lib/libvirt/qemu/nvram/dnsserver-vm_VARS.fd</nvram>
Looks like this is where your Cent OS 7 stores the EFI variables (which determines the boot entries and order). Proxmox stores them on an EFI Disk. I don't know how to convert one to the other but I think that this causes the boot failure inside the VM.

The import complete, however the VM did not boot. I received the error below:

View attachment 73054
I don't know why you get a security violation but maybe secure boot is enable inside the VM (and messing with stuff like this is what secure boot is meant to prevent)?

Maybe try running a boot repair inside your VM (which depends on the OS inside the VM) to fix the boot entries? I guess it's very similar to putting a boot driver in another physical machine (as that also often requires a boot loader fix-up).
 
Hi @leesteken, thanks for the reply.

Looks like this is where your Cent OS 7 stores the EFI variables (which determines the boot entries and order). Proxmox stores them on an EFI Disk. I don't know how to convert one to the other but I think that this causes the boot failure inside the VM.

Thanks for pointing that out! I didn't even see that. Yea I'm not sure how I would export that as well. I was thinking maybe I can convert the VM to an OVA/OVF file and maybe import into Proxmox that way. What do you think? Not sure if the export would grab that but I could give it a go. The VM I am using to test isn't important so losing it won't be an issue. I have another VM that is running TrueNAS and it was created with UEFI. I guess if worse comes to worse, I can backup the config of TureNAS, create a new VM in Proxmox and install TreuNAS, then restore from the backup. Just trying to avoid that if possible :/

I don't know why you get a security violation but maybe secure boot is enable inside the VM (and messing with stuff like this is what secure boot is meant to prevent)?

Maybe try running a boot repair inside your VM (which depends on the OS inside the VM) to fix the boot entries? I guess it's very similar to putting a boot driver in another physical machine (as that also often requires a boot loader fix-up).

Thanks for this suggestion, let me see what I can do. I'll come back if I need some help.
 
So I think I figured out the issue as to why the VM wouldn't boot. When creating the VM with UEFI, Secure Boot is enabled by default.

I tried creating a new VM so I could restore from a backup but it wouldn't boot either. I found on this forum that Secure Boot is enabled by default and I had to disable it in the BIOS of the VM. After that, I was able to get it to boot.

Thanks for help. Going to try and get my server done this weekend....hopefully.
 
  • Like
Reactions: leesteken

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!