ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    KVM Virtual Machine Boot Order

    IT Discussion
    virtualization kvm boot order
    9
    45
    9.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dafyreD
      dafyre
      last edited by

      Hi All,

      So I have a question for the KVM folks out here... How do you manage the order that your VMs start in?

      For instance, at home, my KVM server boots and several other VMs start before my DHCP server, which causes them to not get an IP address.

      I have an idea on how to manage the boot order...I just want to know what others are doing first.

      1 Reply Last reply Reply Quote 2
      • matteo nunziatiM
        matteo nunziati
        last edited by

        never got the issue on centos at work, but this trick of "dummy service" maybe can solve your problem too.

        just create a dummy services which waits for the network service to be up and let it be started Before libvirtd.
        In this way you do not modify original service unit files but you can add extra dependency between network and libvirt.

        1 Reply Last reply Reply Quote 0
        • dafyreD
          dafyre
          last edited by

          @matteo-nunziati said in KVM Virtual Machine Boot Order:

          never got the issue on centos at work, but this trick of "dummy service" maybe can solve your problem too.

          just create a dummy services which waits for the network service to be up and let it be started Before libvirtd.
          In this way you do not modify original service unit files but you can add extra dependency between network and libvirt.

          That's an interesting take on it. I'll check that out... I've actually been tinkering with doing it a different way. (https://gitlab.com/dafyre/kvm-boot-order)...

          1 Reply Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by

            Is this really not a default option in KVM? I've played with KVM only briefly so haven't had the chance to notice.

            dafyreD 1 Reply Last reply Reply Quote 0
            • dafyreD
              dafyre @DustinB3403
              last edited by

              @dustinb3403 said in KVM Virtual Machine Boot Order:

              Is this really not a default option in KVM? I've played with KVM only briefly so haven't had the chance to notice.

              Not that I'm aware of... Come to think of it, I'm not even sure this is an option in VMware, is it?

              coliverC DustinB3403D 2 Replies Last reply Reply Quote 0
              • coliverC
                coliver @dafyre
                last edited by

                @dafyre said in KVM Virtual Machine Boot Order:

                @dustinb3403 said in KVM Virtual Machine Boot Order:

                Is this really not a default option in KVM? I've played with KVM only briefly so haven't had the chance to notice.

                Not that I'm aware of... Come to think of it, I'm not even sure this is an option in VMware, is it?

                It is.

                1 Reply Last reply Reply Quote 0
                • DustinB3403D
                  DustinB3403 @dafyre
                  last edited by

                  @dafyre said in KVM Virtual Machine Boot Order:

                  @dustinb3403 said in KVM Virtual Machine Boot Order:

                  Is this really not a default option in KVM? I've played with KVM only briefly so haven't had the chance to notice.

                  Not that I'm aware of... Come to think of it, I'm not even sure this is an option in VMware, is it?

                  There is a boot delay, not seeing a boot order specifically.

                  JaredBuschJ 1 Reply Last reply Reply Quote 0
                  • JaredBuschJ
                    JaredBusch @DustinB3403
                    last edited by

                    @dustinb3403 said in KVM Virtual Machine Boot Order:

                    @dafyre said in KVM Virtual Machine Boot Order:

                    @dustinb3403 said in KVM Virtual Machine Boot Order:

                    Is this really not a default option in KVM? I've played with KVM only briefly so haven't had the chance to notice.

                    Not that I'm aware of... Come to think of it, I'm not even sure this is an option in VMware, is it?

                    There is a boot delay, not seeing a boot order specifically.

                    In Hyper-V. It is a boot delay. All guests either boot or not on startup. A binary choice. Then you additionally can choose to delay them.

                    I thought VMWare had a boot order and boot delays. when I last used it (VMWare 5.0)

                    coliverC 1 Reply Last reply Reply Quote 0
                    • coliverC
                      coliver @JaredBusch
                      last edited by

                      @jaredbusch said in KVM Virtual Machine Boot Order:

                      @dustinb3403 said in KVM Virtual Machine Boot Order:

                      @dafyre said in KVM Virtual Machine Boot Order:

                      @dustinb3403 said in KVM Virtual Machine Boot Order:

                      Is this really not a default option in KVM? I've played with KVM only briefly so haven't had the chance to notice.

                      Not that I'm aware of... Come to think of it, I'm not even sure this is an option in VMware, is it?

                      There is a boot delay, not seeing a boot order specifically.

                      In Hyper-V. It is a boot delay. All guests either boot or not on startup. A binary choice. Then you additionally can choose to delay them.

                      I thought VMWare had a boot order and boot delays. when I last used it (VMWare 5.0)

                      You can define a boot order/priority so that one thing starts before others. There is then a boot delay that you can throw at it as well.

                      1 Reply Last reply Reply Quote 2
                      • DustinB3403D
                        DustinB3403
                        last edited by

                        On 6.5 I can find the option for boot delay, but I'm not seeing a boot order. I'm probably just looking in the wrong place but I thought I've seen it before as well.

                        pmonchoP 1 Reply Last reply Reply Quote 0
                        • pmonchoP
                          pmoncho @DustinB3403
                          last edited by

                          @dustinb3403 said in KVM Virtual Machine Boot Order:

                          On 6.5 I can find the option for boot delay, but I'm not seeing a boot order. I'm probably just looking in the wrong place but I thought I've seen it before as well.

                          If you mean VMware 6.5, Select Host -> Configure -> Virtual Machines. Put your selected VM's in Automatic in the order you want them to start up and the delay between each startup.

                          DustinB3403D 1 Reply Last reply Reply Quote 0
                          • black3dynamiteB
                            black3dynamite
                            last edited by

                            Uncomment START_DELAY=0 in /etc/sysconfig/libvirt-guests file.

                            https://access.redhat.com/discussions/685243
                            0_1533138645107_8657357f-89b9-4565-a0ba-c6a64389a585-image.png

                            0_1533138783472_51e96b88-60ae-443b-8cbc-2c3ebac10574-image.png

                            matteo nunziatiM 1 Reply Last reply Reply Quote 1
                            • scottalanmillerS
                              scottalanmiller
                              last edited by

                              You can also use crontab and virsh and make them not just have an order, but make them wait for each other as well.

                              1 Reply Last reply Reply Quote 1
                              • DustinB3403D
                                DustinB3403 @pmoncho
                                last edited by

                                @pmoncho said in KVM Virtual Machine Boot Order:

                                @dustinb3403 said in KVM Virtual Machine Boot Order:

                                On 6.5 I can find the option for boot delay, but I'm not seeing a boot order. I'm probably just looking in the wrong place but I thought I've seen it before as well.

                                If you mean VMware 6.5, Select Host -> Configure -> Virtual Machines. Put your selected VM's in Automatic in the order you want them to start up and the delay between each startup.

                                I don't see that anywhere in my installation, probably because we're using the free version of ESXi. . . (yes I know)

                                pmonchoP 1 Reply Last reply Reply Quote 0
                                • ObsolesceO
                                  Obsolesce
                                  last edited by

                                  I've only ever been aware of the autostart option in Virtual Machine Manager:

                                  0_1533144456858_4b552e40-b8eb-49e7-957a-d54ec5596ee8-image.png

                                  Or via virsh autostart:

                                  0_1533144495370_c7baea6a-f3f0-4e0f-bfbb-e3b08cab477b-image.png

                                  So perhaps the easiest way to do this, since there's no built-in function like Hyper-V's, is to disable autostart of all VMs, and then create a bash startup script that starts the VMs one by one, using virsh start, and then adding a delay in between.

                                  DustinB3403D 1 Reply Last reply Reply Quote 1
                                  • DustinB3403D
                                    DustinB3403 @Obsolesce
                                    last edited by DustinB3403

                                    @obsolesce That sounds like the exact thing I want to do all day. . . create a script to start my VM's in sequence. . . oh and update said script every time I add or remove a VM.

                                    Rather than having a boot sequence/priority function built in. . .

                                    ObsolesceO 1 Reply Last reply Reply Quote 1
                                    • ObsolesceO
                                      Obsolesce @DustinB3403
                                      last edited by

                                      @dustinb3403 said in KVM Virtual Machine Boot Order:

                                      @obsolesce That sounds like the exact thing I want to do all day. . . create a script to start my VM's in sequence. . .

                                      Rather than having a boot sequence/priority function built in. . .

                                      I know exactly what you mean... I had the timing set up good in Hyper-V that has about 70 VMs... but the automatic startup was not reliable at all. So I created a PowerShell script to do it on boot, which worked great. But was just one more thing to worry about when a new VM was created. Non-existant VMs didn't matter, it would throw an error in PowerShell, but would continue on which wasn't an issue.

                                      1 Reply Last reply Reply Quote 0
                                      • DustinB3403D
                                        DustinB3403
                                        last edited by

                                        Don't get me wrong, I don't mind making a script to do things, but it's just an added pain, and if you set it up and forget it then the code becomes cobwebbed in your brain, you forget, have an issue, have to remember what you did. It's an ordeal that really shouldn't exist.

                                        Boot priority seems like one of those things that should've been included from the get-go. Like seatbelts in cars are today. . .

                                        ObsolesceO dafyreD 2 Replies Last reply Reply Quote 2
                                        • ObsolesceO
                                          Obsolesce @DustinB3403
                                          last edited by

                                          @dustinb3403 said in KVM Virtual Machine Boot Order:

                                          Don't get me wrong, I don't mind making a script to do things, but it's just an added pain, and if you set it up and forget it then the code becomes cobwebbed in your brain, you forget, have an issue, have to remember what you did. It's an ordeal that really shouldn't exist.

                                          Boot priority seems like one of those things that should've been included from the get-go. Like seatbelts in cars are today. . .

                                          Yeah I agree. I don't use the script anymore. I do it all manually now. It's just less to worry about when you can select multiple, right-click, turn on...

                                          I have the very few important ones set to automatically turn on first, like DHCP, AD, and some of the databases. Hyper-V can handle doing a few without issue.

                                          1 Reply Last reply Reply Quote 0
                                          • DustinB3403D
                                            DustinB3403
                                            last edited by

                                            Just as a note, this problem of startup order appeared to have been an issue since the inception of KVM and even before. It's as if the devs simply thing a startup delay or manually starting your VM's is sufficient. . .

                                            ObsolesceO 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post