-
Notifications
You must be signed in to change notification settings - Fork 818
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
cc_disk_setup always overwrites filesystem on raw disk #3902
Comments
Launchpad user James Falcon(falcojr) wrote on 2021-09-14T14:01:46.414254+00:00 Is it possible for you to post your entire disk_setup/fs_setup in your user data and also attach the tarball from "cloud-init collect-logs"? I think the mismatch in expectations it that cloud-init will overwrite the FS if you've specified something to be written that doesn't match what it finds on disk. Either that or we have a bug detecting what's on disk. If what you've specified is found, we should be exiting early here: If partition isn't specified, it defaults to any. This is described in the docs with: If you attach your logs, I can look to see if there's a mismatch between what you specified and what cloud-init found. |
Launchpad user xstaticxgpx(optimum-reflex) wrote on 2021-09-14T15:53:59.920123+00:00 Agreed, I initially thought something was wrong with the disk labels and that's why it couldn't detect the existing disk and overwrote it. However, that was not the case. The raw disks were definitely labeled correctly however still got overwritten. I had not tried changing the Given the code section I linked above the logic seems pretty clear cut, if the device TYPE is "disk" (as returned by lsblk as seen below) then it will always append the force flag and ultimately overwrite the existing filesystem. From the
Here's what the original
And here's the relevant section of
|
Launchpad user James Falcon(falcojr) wrote on 2021-09-14T16:15:07.080025+00:00 Thanks, I see now. Yes, I agree that this behavior doesn't make sense. For now I'll make a doc change, but I think long term we should change the behavior. |
This bug was originally filed in Launchpad as LP: #1943156
Launchpad details
Launchpad user xstaticxgpx(optimum-reflex) wrote on 2021-09-09T15:21:00.623940+00:00
See
cloud-init/cloudinit/config/cc_disk_setup.py
Lines 1005 to 1009 in 758acf9
Even with
overwrite: false
when using a raw disk device (ie. /dev/sdb) the filesystem will always be overwritten. This seems unintended, as it's definitely not clarified in the documentation.I think at the very least the documentation should be clarified that raw disk devices will ALWAYS be overwritten by default.
We ended up overwriting our
cmd
value to prevent the force flag from being added...The text was updated successfully, but these errors were encountered: