"The agent cannot authenticate until the workspace provision job has been completed"
Trying to create a template for use with XCP-ng/XOA, I am provisioning the VM with cloud-init.
At first start, it works perfectly but when shutting down and restarting the workspace through Coder (and not while directly shutting down the VM) the coder-agent can't authenticate.
full source: https://github.com/Millefeuille42/coder-xcp-xoa-template#
GitHub
GitHub - Millefeuille42/coder-xcp-xoa-template
Contribute to Millefeuille42/coder-xcp-xoa-template development by creating an account on GitHub.
9 Replies
<#1352739141951033366>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
truncated main.tf
cloud init file
The token is not refreshed upon restarts which seems to be the issue, however I don't see what I do differently from other templates that could cause this issues :/
The issue is that the root disk's lifetime is permanent, meaning that it wont be re-init upon restart. The XOA provider doesn't permit "volatile" disks at the time meaning that I have to find a solution for this.
You need a way to reinject the new token on each start.
It looks like the cloud init doesn't run on subsequent restarts
So the agent never gets the new token
@Millefeuille ^
usually you'd want to destroy the VM to avoid this issue
or cloud-init is usually ran at every boot by most cloud providers, but it would seem that it's not the case here
Thanks for the feedback!
I'm working on a disk provider for XOA so I can have an ephemeral disk for root and a persistent one for home, currently the only solution is to delete the whole vm upon restarts, meaning the home gets wiped out. Once I get the disk provider to work, the issue would be solved
I might have to tweak some parameters, but I'm learning Terraform and cloud-init at the same time. I'll take some time with the DevOps/IT guys to know if there is a solution that wouldn't require some code X)
Idk if it's ok for you, but I'd suggest to mark the issue as closed once I get it to work with XOA ?
hmm, yeah usually you would be able to keep the disk but not the template, this is likely an XOA thing
you should take a look at how we do it with other cloud providers, maybe it could help
Will take a deeper look, thanks for the info !
also, on another note, we'll be at KubeCon EU next week so feel free to drop by our booth if you're there!
Idk if it's ok for you, but I'd suggest to mark the issue as closed once I get it to work with XOA ?definitely, also please share the solution once you find it, it'll help other users down the line :-)
Won't be there this year unfortunately but I'd be happy to drop by next time / at another con !