-
Notifications
You must be signed in to change notification settings - Fork 72
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
[Bug]: volume automount on attachment doesn't work as expected on server recreation #473
Comments
Hi @Handaleh, I was able to reproduce the issue. According to my tests the problem appears as soon as your user-data contains a As a workaround can you please try including the following in the
This is the command we would execute if it would not be overwritten. |
we also stumbled about this issue for the Additionally their should be implemented an argument resource "hcloud_server" "node1" {
name = "node1"
image = "ubuntu-22.04"
server_type = "cx11"
}
resource "hcloud_volume" "important-data" {
name = "important-data"
size = 50
mount_point = "/mnt/my-volume-mount-point"
server_id = hcloud_server.node1.id
automount = true
format = "ext4"
} |
This could probably be averted by specifying a merge_type: "list(append)+dict(recurse_list)+str()" This will cause runcmd directives to be appended, rather than overwritten. This is a rather obscure feature of cloud-init, and curiously, I've just opened a PR to improve the documentation on it: cloudinit.readthedocs.io/en/latest/reference/merging.html Edit: Seconding the desire for a |
This also happen also when creating a server with user_data defined. Volume is created and attached, but the mounting does not take place. |
This comment was marked as off-topic.
This comment was marked as off-topic.
My two cents for this one! Or something else mitigating current scripts based on implementation details being subject to change. |
Not working for me while above |
I'm guessing this is still an open issue? |
Yepp! |
What happened?
Auto mount doesn't work when a
hcloud_volume_attachment
is recreated to attach a currently existing volume to a newly built(recreated) instance(hcloud_server
).My setup is pretty simple:
The first time it's applied, all works as expected:
user-data.yaml
) is also executed successfully(installs and configures few tools on the server)Now I apply few changes in the script(something like
echo "re-run!"
, now:The text was updated successfully, but these errors were encountered: