- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 153
Add option to configure TimeoutSec for vms #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| Changed to draft, because i have not yet confirmed if this will resolve the issue | 
| While the option is sensible, the default of 90s is already quite high. VMs should boot within a minute. However, performance has degraded sometime in the last year and we're still figuring out the reason. | 
| Yeah, this patchset does feel like treating the symptom not the cause. In my case the VM has booted, but I can login with ssh. But it restarts anyways because nextcloud-setup.service can take a long time to finnish when it needs to stuff like reindexing a database. It seems to me that the deeper issue is that vmrunner does not differentiate between "booted" and "all oneshoot services on startup being completed" | 
| I am using this as test systemds # in the guest vm conf
  systemd.services."expensive-oneshot" = {
    enable = true;
    after = ["postgresql.service"];
    requires = ["postgresql.service"];
    before = ["long-derp.service"];
    wantedBy = ["multi-user.target"];
    script = ''
      #!/usr/bin/env bash
      echo running dummy script
      for i in {0..200}
      do
        sleep 1
        echo "Number: $i of 200"
      done
    '';
    serviceConfig = {
      Type = "oneshot";
    };
  };
  systemd.services."long-derp" = {
    enable = true;
    wantedBy = ["multi-user.target"];
    script = ''
      #!/bin/bash
      while true :
      do
      echo "Dont mind me"
      sleep 1
      done
    '';
    serviceConfig = {
      Type = "simple";
    };
  }; | 
| So i conculude if 
 With the default timeout setting this vm configuration gets stuck in endless rebooting. I assume this is because all services wanted multi-user.target is not reached in time. But using the new proposed setting, I can give my vms enough time to complete my dummy setup service.  microvm = {
    host.startupTimeout = 500;
}I have tested and confirmed that this solves #317 I will mark this pr as ready for merge. Do you want me to write some test, or is "trust me bro" good enough? | 
| To speed things up, I added some review comments :) | 
should resolve issue #317
Make the default timeout for vm starup an option