-
Notifications
You must be signed in to change notification settings - Fork 932
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
Device: Don't remove an existing target directory when unmounting a disk
device if the original dir hasn't been created by LXD
#12700
base: main
Are you sure you want to change the base?
Commits on May 23, 2024
-
api: Add
disk_state_created
API extensionSigned-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 0a88c2f - Browse repository at this point
Copy the full SHA 0a88c2fView commit details -
api: Introduce a new
AgentDeviceRemove
typeSome devices like disk devices with a target path need to be cleanly unmounted. In the case of a VM instance, we prefer to handle the unmount logic within the agent and handle the unmounting of the potential overmounts of the guest. In some cases, we also need to remove a path resource (or not) on the guest side. That is why we also pass some extra metadata contained in the `Volatile` field, to handle the resource removal process in the agent and not on the LXD side (this would result in spawning aan SFTP client, which is a wasteful approach) Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 7f97b2e - Browse repository at this point
Copy the full SHA 7f97b2eView commit details -
instance/instancetype/instance: Add a new volatile key `volatile.<dis…
…k_dev_name>.last_state.created` for the disk device Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for d3ef8d9 - Browse repository at this point
Copy the full SHA d3ef8d9View commit details -
lxd/device/disk: Add the device name to the mount entry when stopping…
… a device Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 145b6fe - Browse repository at this point
Copy the full SHA 145b6feView commit details -
lxd/instance/drivers/lxc: detect if we need to remove a target direct…
…ory when unmounting When a disk device is removed while relying on a host directory and mapped to a target within a container, we detect if the target directory has been created by LXD or not in order to not delete the content of a target directory during the unmount. Example: - Let say we mounted a custom host empty directory (`test`) on the existing `/opt` directory of the container, when unmounted (`lxc device remove ...`), the target `/opt` won't be removed, because we marked it as NOT being created by LXD at mount time. - If, however, we created a custom empty target directory at mount time: `lxc config device add u1 test disk source=/home/user/test path=/new_dir`, the directory `new_dir` will be created on the target instance and if we decide to unmount `test`, the target `/new_dir` will be removed because is has been created by LXD Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 77aace6 - Browse repository at this point
Copy the full SHA 77aace6View commit details -
lxd/instance/drivers/qemu: fix error formatting
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 0235a7e - Browse repository at this point
Copy the full SHA 0235a7eView commit details -
lxd-agent: unmount logic inside a VM
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for bbacb20 - Browse repository at this point
Copy the full SHA bbacb20View commit details -
lxd-agent: expose the
DELETE 1.0/devices
VM agent endpointSigned-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 5f9560c - Browse repository at this point
Copy the full SHA 5f9560cView commit details -
lxd/instance/drivers/qemu: Add the
devlxdDeviceRemove
functionSigned-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for b6240cb - Browse repository at this point
Copy the full SHA b6240cbView commit details -
lxd/instance/driver_qemu: Ensure the underlying VM virtiofs mount has…
… been unmounted Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 8e0a4a5 - Browse repository at this point
Copy the full SHA 8e0a4a5View commit details -
test: Check that we can still access the target dir if it hasn''t bee…
…n created by lxd Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 6164750 - Browse repository at this point
Copy the full SHA 6164750View commit details -
lxd/metadata: update metadata configuration
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for a48fd44 - Browse repository at this point
Copy the full SHA a48fd44View commit details -
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Configuration menu - View commit details
-
Copy full SHA for 4139a48 - Browse repository at this point
Copy the full SHA 4139a48View commit details