Update boot sequence without rebooting VM

Mar 15, 2022
10
2
8
When changing the boot order on a VM, you have to power the VM off and back on for it to apply. Is it possible to force pending changes to update without poweroff/on to change the boot order on a VM?
 
The settings you have there are send to the QEMU/KVM-process on it's start, so even if you did set the setting, it wouldn't do anything anyway without till the process is started again, which only happens on a boot (reboot from the GUI also does it, as that sends a shutdown and then a start right after).
 
  • Like
Reactions: flightofthebumble
Thank you for the info, sw-omit. I am trying to find a solution for this, as part of a procedure the VM OS itself initiates the reboot command. I need to find some way for Proxmox to carry out a power off upon OS initiated restart to apply these vm conf changes. I think I might need to look into a custom SeaBIOS rom for the VM. If you can think of any other way to apply these changes without a poweroff/on, please post - many thanks.
 
Other thought, I take it that this is during the installation, and you need it to no longer boot from iso or network and from disk instead?

If so: Just put the disk first and the iso/network after right during setup, since the disk is empty then still, it will just skip over it the first time, and the next boot it works right away.
 
  • Like
Reactions: flightofthebumble
This is not in the install part of OS deployment, this is after an OS is already installed. As part of a virtual cluster process, a script runs to connect to the vBMC, utilizing the Proxmox API. The script calls for the host to reboot after a virtual ISO is inserted into the ide2 drive of the VM. Then either a bootonce to CDROM command is required, or the boot order is required to be changed and applied without full poweroff/poweron again. At present, I cannot see a way of doing this short of writing a custom SeaBIOS to invoke a HALT command upon restart. I don't have knowledge on how to do this, but I am trying to find a way. If possible (and if the Proxmox devs are watching this forum) if there is a way of adding a bootonce, or change boot order without poweroff/on in an upcoming release, it would really help.
 
Last edited:
I'm not fully understanding what you mean, sorry.
Just to check though, am I correctly understanding that you're sending the reboot to the "vm" but are also already talking to the Proxmox API on the "host" for that VM?
If so, why not use another API-call to reboot (or if that fails, reset) from the host instead of the vm. Both should cause the qemu-process to end and apply new configs during the next start.
https://pve.proxmox.com/pve-docs/api-viewer/#/nodes/{node}/qemu/{vmid}/status/reboot

Again, might just not understand something correctly, but thought to throw that option out there at least.
 
If you set the HA option to make sure the VM is always started, then a guest shutdown instead of reboot will have the same effect. Which is a good idea regardless so your customers don’t accidentally shut down a system and then ask you to boot it.
 
Thank you for your queries/responses. Just to clarify:
I have 4 x VMs running a virtualized cluster OS on Debian. As part of a redeploy/lab reset for my testing, I need to ensure that a reboot of a VM is initiated from core cluster VMs, not by Proxmox. That is, debian on VMs 1/2/3 call for VM4 to change vBMC boot order and then the reboot is initiated within the OS on VM4. I cannot change this process, it is out of scope for my testing. I need a way to apply the boot sequence change, without rebooting via Proxmox. I don't think this is possible in Proxmox, but I am trying to see if these is a way to do this - thanks.
 
So just to be clear, you cannot change the boot order in almost any hardware without hard-resetting the device. There are various security issues with what you are trying to do, basically a malware could abuse a mechanism like that, if it were in the OS, to boot a malicious boot chain which would allow for undetectable malware.

What are you “allowed” to do or what are you trying to effectuate? How would you do this on a regular physical device? If you only have software OS control, then you would have to manage a boot loader like Grub to do this but do note that SecureBoot/TPM and the like will not like what you are doing.
 
Last edited:
So this is for VMs only. You actually can change the boot order on Hardware, using bootonce commands on iLO/iDRAC/Supermicro IPMI and also using redfish API. In OpenStack (which is what this OS utilizes), you can provide connection to these BMC types and change the bootorder using IPMI or Redfish. I am looking for a way to do this on a Proxmox VM, only.
 
So the equivalent to IPMI/RedFish/BMC in hardware is the Proxmox API which you can use to change the boot order, shutdown etc. But you said earlier you are not allowed to go outside the OS and change the Proxmox configuration. All you need is to call the web API, like you would call the iDRAC API over a web interface. You can do this with Ansible or Proxmoxer or write your own API calls, if you really need RedFish interoperability, you can implement a web app that implements the RedFish API (which is open) and translates it to Proxmox API (which is open), but if you are writing the management software, that sounds like a lot of work for no benefit.
 
Last edited:
Yes, I understand and have created/called Proxmox API commands using redfish. My main issue remains and my question is outstanding, I cannot apply the boot order change unless the VM is fully powered off and on. It actually is a benefit for me, as I am replicating a Day2 Telco oRAN environment with ZTP. Now if you don't know of a way to do this, that's fine. I don't need an opinion on why I am doing this, I just need to know if anyone has been able to do this and how they did it.
 
So call the API to do the ACPI shutdown, or use the OS shutdown and set Proxmox to make sure it starts up again. Just like you would have to call the IPMI API to do a ACPI shutdown and then after it is shut down, the BMC stages the UEFI setting and starts the machine up again. I don't see what the problem is.
 
The Openstack doesn't do that in this case, it initiates the shutdown from the OS. I also didn't state that I was using UEFI in the VM config. Again, I need to know if there is a way to apply a boot order change, on a VM, without having to shut it down and power it back on. This is possible, on physical hardware, via iLO/iDRAC/etc. I don't think that your responses are helping. Please do not comment further in this thread.
 
Almost everything these days is using UEFI, I haven't seen hardware in a decade that is on BIOS. If you soft-reboot a device you are not guaranteed to go back through the BIOS/UEFI, most UEFI these days will skip a lot of the initialization in a simple case of soft reboot, which is what QEMU is also doing if you ask for a simple reboot (rebooting without re-initializing the firmware/hardware).

If you change a UEFI setting through BMC such as iDRAC, you are not actually setting that setting until there is a hard reset, the BMC hides what it is actually doing, but it stages the change until it detects a reboot, goes into a special mode to change the setting and then does a hard reset of the hardware (practically speaking, a power off and power on) which then does things like re-enumerate the hardware (hence why the first boot after a change in iDRAC is so slow, 5 minutes vs 30s), that's is also why you can see the machine "rebooting" 2 or 3 times after you make changes through iDRAC.

So again, what you need to do is emulate what the BMC does: stage the settings in Proxmox, wait for a shutdown from the OS (shutdown -h in Linux), then if you have the HA setting enabled, once it is shut down, Proxmox will start the VM up again with the new setting. That is an exact replica of what the BMC does.
 
Last edited:

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!