Not necessarily issue, looking for advice/guidance on a couple topics
Closed this issue · 6 comments
-
Windows startup script
sysprep-specialize-script-ps1
gets ignored in our custom image
Not sure why, I assume that since sincesysprep-specialize-script-ps1
only runs on first boot, and our image is a custom its technically not first boot? Does anyone know how to reset the state of the image's source so thatsysprep-specialize-script-ps1
is executed? I had to change the https://github.com/cloudbase/garm-provider-gcp/blob/main/internal/client/gcp.go#L39 towindowsStartupScript string = "windows-startup-script-ps1"
-
Windows startup script ran "too fast", aka before network setup is complete causing "unable to find route to "
I had to hack in a 5 second sleep to beginning of the install script for windows, and it helps but there are still occasional hiccups where network still failing. Could we add some smart retry functionality to the startup script network calls? or a check for network stability and/or route existence, not sure how that would work.
Hello @Hdom,
Regarding the first part, the answer is thatsysprep-specialize-script-ps1
runs just once, during the initial boot, which was done already when you created the custom image. This is the order of script execution
On the other hand, windows-startup-script-ps1
runs First during each boot after the initial boot, which may cause problems, based on the script used.
Also, can youu describe more the issue regarding Windows startup script ran "too fast",?
@fabi200123 I think networking comes up after the script runs, and the script simply fails because it has no network connectivity. This is a transient error and should be retried.
Here is an example of a commandlet that retries an operation:
We could integrate something like that into the Windows userdata wherever it's needed. The curl command line has the retry flag, but the Windows equivalents do not. So they will most likely need to be wrapped.
Once Windows Server 2016 reaches EoL, we can use curl.exe on Windows as well, but until then, let's see how we can incorporate the above commandlet (or something similar).
Hello @Hdom, Regarding the first part, the answer is that
sysprep-specialize-script-ps1
runs just once, during the initial boot, which was done already when you created the custom image. This is the order of script execution On the other hand,windows-startup-script-ps1
runs First during each boot after the initial boot, which may cause problems, based on the script used.Also, can youu describe more the issue regarding Windows startup script ran "too fast",?
So would we need a feature to allow configuring custom images to run with windows-startup-script-ps1
?
@fabi200123 I think networking comes up after the script runs, and the script simply fails because it has no network connectivity. This is a transient error and should be retried.
Here is an example of a commandlet that retries an operation:
We could integrate something like that into the Windows userdata wherever it's needed. The curl command line has the retry flag, but the Windows equivalents do not. So they will most likely need to be wrapped.
Once Windows Server 2016 reaches EoL, we can use curl.exe on Windows as well, but until then, let's see how we can incorporate the above commandlet (or something similar).
Yes that is exactly right, most likely just need a retry a couple times and sleep between retries.
Regarding the windows-startup-script-ps1
, we should be able to add it as an extra-spec field and just add it to the instance's metadata.
What do you think @gabriel-samfira?
@Hdom when you created your custom image, did you run GCESysprep on it as described here:
This should generalize the image and set it in a state where it will run sysprep-specialize-script-ps1
@gabriel-samfira that's probably what it is, no, I wasn't aware of the GCESysprep, I will give it a try, thank you.