XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    vm start delay - does it work yet?

    Scheduled Pinned Locked Moved Xen Orchestra
    8 Posts 5 Posters 2.9k Views 5 Watching
    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.
    • akurzawaA Offline
      akurzawa
      last edited by Danp

      Hi

      From my obercation the start dealy is not working - I look like the vms are stariting all together at boot. Since when this function is avaialbe in xoa?

      e6d70680-6313-4920-ba6d-2ba247a01953-image.png

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Online
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        Start delay works when the VM is started with a VM.start. I'm not sure delay is meant to work with auto power.

        Details on XAPI: https://xapi-project.github.io/xen-api/classes/vm.html

        The delay to wait before proceeding to the next order in the startup sequence (seconds)

        Regarding the feature, it's available since XOA 5.33, see https://github.com/vatesfr/xen-orchestra/blob/master/CHANGELOG.md#5330-2019-03-29

        akurzawaA 1 Reply Last reply Reply Quote 0
        • akurzawaA Offline
          akurzawa @olivierlambert
          last edited by

          olivierlambert said in vm start dealy - does it work yet?:

          I'm not sure delay is meant to work with auto power.

          Where could I veryify the functionality of delay and autopower ?

          1 Reply Last reply Reply Quote 0
          • olivierlambertO Online
            olivierlambert Vates 🪐 Co-Founder CEO
            last edited by

            Put a large delay on a VM (eg 600 secs, 10min), and put in on autopower. Then reboot your host. Is the VM booted before 10min? If yes, then autopower in XAPI doesn't take into account the delay.

            1 Reply Last reply Reply Quote 0
            • P Offline
              payback007
              last edited by

              unfortunately "start delay" is not working as expected. The function what you marked above is to change the start delay of an existing "vApp". Here is an example of my setup:

              04e7439d-6b92-4356-aa23-14d704588be3-grafik.png

              The value whould change the "Delay interval" later by XOA, nothing else. Otherwise is vApp feature also not working on my XCP-ng installation, I think it was never really tested.

              If you want to implement start delays to your VM's you can follow this guide:

              1. define vApp for autostart in xcp-ng center including start order
              2. find out the uuid of the vApp:
              xe appliance-list
              
              1. write autostart script containing
              #!/bin/sh
              xe appliance-start uuid=uuid-autostart-vApp
              
              1. implement new systemd.service in /etc/systemd/system/autostart.service
              [Unit]
              Description=autostart script for boot VM
              After=graphical.target
              
              [Service]
              Type=simple
              ExecStart=/path/to/your/autostart-script.sh
              TimeoutStartSec=0
              
              [Install]
              WantedBy=default.target
              
              1. enable the service
              systemctl enable autostart.service
              

              Editing of boot delay time is then possible via XOA which is already a nice feature at all for "fine tuning" or adapt if new VMs are added to the autostart vApp.

              olivierlambert whould it make sense to open an additional feature request? vApp-implementation was several times discussed with no "final statement" I think.

              S cairotiC 2 Replies Last reply Reply Quote 4
              • S Offline
                sasha @payback007
                last edited by

                payback007
                Thank you for sharing this. So far this is the one simple and reliable way to start VM in the desired order.

                1 Reply Last reply Reply Quote 0
                • P Offline
                  payback007
                  last edited by

                  The only thing is to think on that script during a major update of xcp-ng to a newer version. Because after installation the autostart.service has to be implemted again.

                  1 Reply Last reply Reply Quote 1
                  • tjkreidlT tjkreidl referenced this topic on
                  • D Davidj 0 referenced this topic on
                  • cairotiC Offline
                    cairoti @payback007
                    last edited by

                    payback007 said in vm start delay - does it work yet?:

                    unfortunately "start delay" is not working as expected. The function what you marked above is to change the start delay of an existing "vApp". Here is an example of my setup:

                    04e7439d-6b92-4356-aa23-14d704588be3-grafik.png

                    The value whould change the "Delay interval" later by XOA, nothing else. Otherwise is vApp feature also not working on my XCP-ng installation, I think it was never really tested.

                    If you want to implement start delays to your VM's you can follow this guide:

                    1. define vApp for autostart in xcp-ng center including start order
                    2. find out the uuid of the vApp:
                    xe appliance-list
                    
                    1. write autostart script containing
                    #!/bin/sh
                    xe appliance-start uuid=uuid-autostart-vApp
                    
                    1. implement new systemd.service in /etc/systemd/system/autostart.service
                    [Unit]
                    Description=autostart script for boot VM
                    After=graphical.target
                    
                    [Service]
                    Type=simple
                    ExecStart=/path/to/your/autostart-script.sh
                    TimeoutStartSec=0
                    
                    [Install]
                    WantedBy=default.target
                    
                    1. enable the service
                    systemctl enable autostart.service
                    

                    Editing of boot delay time is then possible via XOA which is already a nice feature at all for "fine tuning" or adapt if new VMs are added to the autostart vApp.

                    olivierlambert whould it make sense to open an additional feature request? vApp-implementation was several times discussed with no "final statement" I think.

                    When I have a pool without HA, how could I use this script?

                    I thought about setting the script on the master server. However, in a maintenance, where a second node becomes the master, will I have to recreate the script?

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post