Skip to content
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

Import LXD changes from stable-5.0 #988

Merged
merged 79 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
4802dfe
[lxd-import] github: stop purging core20
simondeziel Feb 6, 2024
ff1139c
[lxd-import] github: purge disabled/superseded snaps
simondeziel Feb 6, 2024
759d9ae
[lxd-import] github: move snap removal to "Reclaim some space" step
simondeziel Feb 8, 2024
a9f71e8
[lxd-import] github: put docker removal its own step
simondeziel Feb 8, 2024
757aa2a
[lxd-import] github: mask lxc{,-net}.service in a singe command
simondeziel Feb 8, 2024
75a5821
[lxd-import] lxd/instance/drivers/driver/qemu: Don't leak file descri…
tomponline Feb 28, 2024
1c675aa
[lxd-import] lxd/network/acl: Change protocol field for ovn logs
masnax Mar 6, 2024
2582864
[lxd-import] lxd/instance: Reject limits.kernel config for VMs
MggMuggins Mar 5, 2024
bfbc3e8
[lxd-import] doc: `limits.kernel` only applies to containers (see #12…
MggMuggins Mar 5, 2024
f3c5660
[lxd-import] lxd/storage: Fix resize for pools with custom zfs.pool_name
MggMuggins Mar 11, 2024
550cb34
[lxd-import] lxd/storage/drivers/driver_zfs_utils: fix typos
simondeziel Dec 13, 2023
e0342b8
[lxd-import] lxd/storage/drivers/driver_zfs_utils: make it explicit t…
simondeziel Dec 13, 2023
0453d0a
[lxd-import] lxd/task/group: Make cancel type of context.CancelFunc f…
tomponline Jan 8, 2024
f26bae1
[lxd-import] doc: Add paragraph on how to delete images
ggouzi Jan 8, 2024
6f9bb38
[lxd-import] test: Add exec exit code test
MusicDin Jan 5, 2024
504ef33
[lxd-import] lxd/apparmor: allow confined services to receive require…
alexmurray Jan 9, 2024
98e7f61
[lxd-import] lxd/rsync: Consistently compare files on nanosecond basis
roosterfish Jan 8, 2024
3e18a4e
[lxd-import] test/suites/migration: Check for file contents after ref…
roosterfish Jan 8, 2024
0e61e82
[lxd-import] test/suites/migration: Check local and remote instance r…
roosterfish Jan 9, 2024
a114cac
[lxd-import] doc: add paragraph on how to delete images
ggouzi Jan 17, 2024
99c7cfd
[lxd-import] doc: enable multiprocessing for pyspelling
ru-fu Jan 19, 2024
5ee3277
[lxd-import] Makefile: have run-parts report which script it runs
simondeziel Jan 19, 2024
92aad5c
[lxd-import] lxd/storage/drivers/ceph: Disable filesystem config keys…
roosterfish Feb 1, 2024
8d8e4b3
[lxd-import] lxd/storage/drivers/lvm: Disable filesystem config keys …
roosterfish Feb 1, 2024
b8265bf
[lxd-import] test: Add check to restore custom volumes of type block
roosterfish Feb 1, 2024
5c8bad0
[lxd-import] lxd/storage/drivers/ceph: Update UnmountVolumeSnapshot d…
roosterfish Feb 1, 2024
a112563
[lxd-import] lxd: Improve error check for existing certificates
masnax Jan 31, 2024
8e0fb7f
[lxd-import] shared/api: Updates swagger description for certificate …
markylaing Feb 2, 2024
5e1bb54
[lxd-import] shared/api: Fix lint errors (receiver-naming).
markylaing Feb 2, 2024
808b09e
[lxd-import] lxd/db/cluster: Fix lint error (revive: var-naming).
markylaing Feb 6, 2024
a636145
[lxd-import] lxd-migrate: Ignore lint error (revive: deep-exit).
markylaing Feb 7, 2024
b719a16
[lxd-import] lxc/remote: Fix lint errors (revive: exported).
markylaing Feb 7, 2024
1ce1b5f
[lxd-import] lxd/storage/backend: Don't validate custom storage volum…
roosterfish Feb 12, 2024
124b51c
[lxd-import] lxd-generate: Return helpful error instead of panicking.
markylaing Feb 15, 2024
5690dd9
[lxd-import] lxd/storage/backend: Use quotes consistently for error m…
roosterfish Feb 14, 2024
2f195fb
[lxd-import] lxd/project: Don't panic on StorageVolumeParts
roosterfish Feb 16, 2024
0b3596c
[lxd-import] github: don't abort on remount failures
simondeziel Feb 19, 2024
0eac391
[lxd-import] test/main: add log grouping (GHA)
simondeziel Feb 21, 2024
e08baae
[lxd-import] test/main: show dmesg on failure
simondeziel Feb 21, 2024
5554339
[lxd-import] lxd/api/internal: Use correct quoting for error in inter…
tomponline Feb 22, 2024
7c794c0
[lxd-import] lxd/db/cluster/devices: Use correct string quoting of de…
tomponline Feb 22, 2024
45e17ba
[lxd-import] lxd/instances/post: Improve error in createFromBackup
tomponline Feb 22, 2024
6047f49
[lxd-import] lxd/storage/backend/lxd: Update backup.yaml after instan…
tomponline Feb 22, 2024
08582ef
[lxd-import] test/main: don't wrap tests logs in log groups
simondeziel Feb 26, 2024
c509619
[lxd-import] lxd/device/disk: Remove config.iso file when the cloud-i…
tomponline Feb 28, 2024
ac28c49
[lxd-import] lxd/images: Add project to error in autoSyncImages
tomponline Mar 1, 2024
ce8fc8b
[lxd-import] lxd/project/project: Remove optimisation from StorageVol…
tomponline Mar 1, 2024
16e9769
[lxd-import] lxd/storage/volumes: Remove unnecessary 2 line variable …
tomponline Mar 4, 2024
c0197df
[lxd-import] lxd/storage/volumes: Remove unnecessary 2 line variable …
tomponline Mar 4, 2024
795308f
[lxd-import] lxd/storage/volumes: Validate source project in doCustom…
tomponline Mar 4, 2024
7445e14
[lxd-import] [lxd-import] lxd/storage/volumes: Validate source projec…
tomponline Mar 4, 2024
407d111
[lxd-import] lxd/db/cluster: Remove redunant parentheses.
markylaing Mar 5, 2024
7556c7a
[lxd-import] lxd/db/cluster: Rename "node" to "cluster member".
markylaing Mar 5, 2024
accb670
[lxd-import] lxd/migrate/storage/volumes: Use volume name from DB in …
tomponline Mar 6, 2024
2c584a8
[lxd-import] lxd/network/network/utils: Fix incorrect conversion from…
tomponline Mar 8, 2024
01ed53e
[lxd-import] lxd/network/network/utils: Remove unnecessary call to fm…
tomponline Mar 8, 2024
ea898b5
[lxd-import] lxd/response: Use SmartError if SyncResponse success=false
masnax Mar 8, 2024
733e993
[lxd-import] lxd/storage/drivers/driver/zfs/volumes: Fix error scopin…
tomponline Mar 11, 2024
7983fcb
[lxd-import] lxd/storage/drivers/driver/zfs/volumes: Define send/rece…
tomponline Mar 11, 2024
e6bae2b
[lxd-import] lxd/storage/drivers/driver/zfs/volumes: Kill sender if r…
tomponline Mar 11, 2024
bfa8e7b
[lxd-import] lxd/storage/drivers/driver/zfs/volumes: Handle multi-lin…
tomponline Mar 11, 2024
371ac6c
[lxd-import] lxd/storage/drivers/driver/btrfs/volumes: Fix hang when …
tomponline Mar 11, 2024
40c51d5
[lxd-import] lxd/storage/drivers/driver/btrfs/volumes: Handle multi-l…
tomponline Mar 11, 2024
65bde19
[lxd-import] lxd/storage/drivers/driver/zfs/volumes: Aligns RefreshVo…
tomponline Mar 11, 2024
b2bf022
[lxd-import] lxd/response: Fallback to error response after setting h…
masnax Mar 11, 2024
988a4f6
[lxd-import] lxd/storage/backend/lxd: Use volume name from VolumeDBGe…
tomponline Mar 11, 2024
506afcd
[lxd-import] lxd/storage/drivers/btrfs: Clarify fallback in case UUID…
roosterfish Mar 20, 2024
ba343e0
incusd/db/cluster: Fix import shadowing
stgraber Jul 12, 2024
5e199b4
doc/rest-api: Refresh swagger YAML
stgraber Jul 12, 2024
898e5d7
[lxd-import] lxd/db/cluster: Update error messages in unit tests.
markylaing Mar 5, 2024
c6107dd
[lxd-import] lxd/storage/drivers: Add volume param to roundVolumeBloc…
MggMuggins May 10, 2024
ce52be2
[lxd-import] lxd/storage/drivers/zfs: Round to zfs.blocksize or 16KiB
MggMuggins May 10, 2024
aa53cea
[lxd-import] test/storage: Add non-power-of-two sized storage check
MggMuggins May 10, 2024
1d3d2b9
[lxd-import] test/storage: Remove zfs rounding test
MggMuggins May 28, 2024
1cd1508
[lxd-import] lxd/storage/drivers: Refactor volume size rounding logic
MggMuggins May 10, 2024
c3764e9
[lxd-import] lxd/storage/drivers/zfs: Wait for device to appear when …
MusicDin Jun 24, 2024
d6411f8
[lxd-import] lxd/storage/drivers/zfs: Check for non /dev/zvol/* paths
MusicDin Jun 25, 2024
166cf3f
incusd/storage/zfs: Fix import shadowing
stgraber Jul 12, 2024
71b0e89
doc/storage_backup: Fix command example
stgraber Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,16 +164,23 @@ jobs:
# optimize ext4 FSes for performance, not reliability
for fs in $(findmnt --noheading --type ext4 --list --uniq | awk '{print $1}'); do
# nombcache and data=writeback cannot be changed on remount
sudo mount -o remount,noatime,barrier=0,commit=6000 "${fs}"
sudo mount -o remount,noatime,barrier=0,commit=6000 "${fs}" || true
done

# disable dpkg from calling sync()
echo "force-unsafe-io" | sudo tee /etc/dpkg/dpkg.cfg.d/force-unsafe-io

- name: Reclaim some space
run: |
# This was inspired from https://github.com/easimon/maximize-build-space
set -eux

sudo snap remove lxd --purge
# Purge older snap revisions that are disabled/superseded by newer revisions of the same snap
snap list --all | while read -r name _ rev _ _ notes _; do
[ "${notes}" = "disabled" ] && snap remove "${name}" --revision "${rev}" --purge
done || true

# This was inspired from https://github.com/easimon/maximize-build-space
df -h /
# dotnet
sudo rm -rf /usr/share/dotnet
Expand All @@ -183,6 +190,13 @@ jobs:
sudo rm -rf /opt/ghc
df -h /

- name: Remove docker
run: |
set -eux
sudo apt-get autopurge -y moby-containerd docker uidmap
sudo ip link delete docker0
sudo nft flush ruleset

- name: Checkout
uses: actions/checkout@v4

Expand Down Expand Up @@ -213,14 +227,7 @@ jobs:
sudo add-apt-repository ppa:cowsql/stable -y --no-update
sudo apt-get update

sudo snap remove lxd --purge
sudo snap remove core20 --purge || true
sudo apt-get autopurge moby-containerd docker uidmap -y
sudo ip link delete docker0
sudo nft flush ruleset

sudo systemctl mask lxc.service
sudo systemctl mask lxc-net.service
sudo systemctl mask lxc.service lxc-net.service

sudo apt-get install --no-install-recommends -y \
curl \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ endif
flake8 test/deps/import-busybox
shellcheck --shell sh test/*.sh test/includes/*.sh test/suites/*.sh test/backends/*.sh test/lint/*.sh
shellcheck test/extras/*.sh
run-parts --exit-on-error --regex '.sh' test/lint
run-parts --verbose --exit-on-error --regex '.sh' test/lint

.PHONY: staticcheck
staticcheck:
Expand Down
6 changes: 5 additions & 1 deletion cmd/incus-migrate/main_migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ func (c *cmdMigrate) Run(cmd *cobra.Command, args []string) error {
}

cancel()
os.Exit(1)

// The following nolint directive ignores the "deep-exit" rule of the revive linter.
// We should be exiting cleanly by passing the above context into each invoked method and checking for
// cancellation. Unfortunately our client methods do not accept a context argument.
os.Exit(1) //nolint:revive
}()

if clientFingerprint != "" {
Expand Down
19 changes: 17 additions & 2 deletions cmd/incus/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type cmdRemote struct {
global *cmdGlobal
}

// Command returns a cobra.Command for use with (*cobra.Command).AddCommand.
func (c *cmdRemote) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = usage("remote")
Expand Down Expand Up @@ -95,6 +96,7 @@ type cmdRemoteAdd struct {
flagProject string
}

// Command returns a cobra.Command for use with (*cobra.Command).AddCommand.
func (c *cmdRemoteAdd) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = usage("add", i18n.G("[<remote>] <IP|FQDN|URL|token>"))
Expand Down Expand Up @@ -163,7 +165,7 @@ func (c *cmdRemoteAdd) findProject(d incus.InstanceServer, project string) (stri
return project, nil
}

func (c *cmdRemoteAdd) RunToken(server string, token string, rawToken *api.CertificateAddToken) error {
func (c *cmdRemoteAdd) runToken(server string, token string, rawToken *api.CertificateAddToken) error {
conf := c.global.conf

if !conf.HasClientCertificate() {
Expand Down Expand Up @@ -281,6 +283,7 @@ func (c *cmdRemoteAdd) addRemoteFromToken(addr string, server string, token stri
return conf.SaveConfig(c.global.confPath)
}

// Run is used in the RunE field of the cobra.Command returned by Command.
func (c *cmdRemoteAdd) Run(cmd *cobra.Command, args []string) error {
conf := c.global.conf

Expand Down Expand Up @@ -324,7 +327,7 @@ func (c *cmdRemoteAdd) Run(cmd *cobra.Command, args []string) error {

rawToken, err := localtls.CertificateTokenDecode(addr)
if err == nil {
return c.RunToken(server, addr, rawToken)
return c.runToken(server, addr, rawToken)
}

// Complex remote URL parsing
Expand Down Expand Up @@ -669,6 +672,7 @@ type cmdRemoteGetDefault struct {
remote *cmdRemote
}

// Command returns a cobra.Command for use with (*cobra.Command).AddCommand.
func (c *cmdRemoteGetDefault) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = usage("get-default")
Expand All @@ -681,6 +685,7 @@ func (c *cmdRemoteGetDefault) Command() *cobra.Command {
return cmd
}

// Run is used in the RunE field of the cobra.Command returned by Command.
func (c *cmdRemoteGetDefault) Run(cmd *cobra.Command, args []string) error {
conf := c.global.conf

Expand All @@ -704,6 +709,7 @@ type cmdRemoteList struct {
flagFormat string
}

// Command returns a cobra.Command for use with (*cobra.Command).AddCommand.
func (c *cmdRemoteList) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = usage("list")
Expand All @@ -718,6 +724,7 @@ func (c *cmdRemoteList) Command() *cobra.Command {
return cmd
}

// Run is used in the RunE field of the cobra.Command returned by Command.
func (c *cmdRemoteList) Run(cmd *cobra.Command, args []string) error {
conf := c.global.conf

Expand Down Expand Up @@ -788,6 +795,7 @@ type cmdRemoteRename struct {
remote *cmdRemote
}

// Command returns a cobra.Command for use with (*cobra.Command).AddCommand.
func (c *cmdRemoteRename) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = usage("rename", i18n.G("<remote> <new-name>"))
Expand All @@ -809,6 +817,7 @@ func (c *cmdRemoteRename) Command() *cobra.Command {
return cmd
}

// Run is used in the RunE field of the cobra.Command returned by Command.
func (c *cmdRemoteRename) Run(cmd *cobra.Command, args []string) error {
conf := c.global.conf

Expand Down Expand Up @@ -867,6 +876,7 @@ type cmdRemoteRemove struct {
remote *cmdRemote
}

// Command returns a cobra.Command for use with (*cobra.Command).AddCommand.
func (c *cmdRemoteRemove) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = usage("remove", i18n.G("<remote>"))
Expand All @@ -888,6 +898,7 @@ func (c *cmdRemoteRemove) Command() *cobra.Command {
return cmd
}

// Run is used in the RunE field of the cobra.Command returned by Command.
func (c *cmdRemoteRemove) Run(cmd *cobra.Command, args []string) error {
conf := c.global.conf

Expand Down Expand Up @@ -930,6 +941,7 @@ type cmdRemoteSwitch struct {
remote *cmdRemote
}

// Command returns a cobra.Command for use with (*cobra.Command).AddCommand.
func (c *cmdRemoteSwitch) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Aliases = []string{"set-default"}
Expand All @@ -951,6 +963,7 @@ func (c *cmdRemoteSwitch) Command() *cobra.Command {
return cmd
}

// Run is used in the RunE field of the cobra.Command returned by Command.
func (c *cmdRemoteSwitch) Run(cmd *cobra.Command, args []string) error {
conf := c.global.conf

Expand All @@ -977,6 +990,7 @@ type cmdRemoteSetURL struct {
remote *cmdRemote
}

// Command returns a cobra.Command for use with (*cobra.Command).AddCommand.
func (c *cmdRemoteSetURL) Command() *cobra.Command {
cmd := &cobra.Command{}
cmd.Use = usage("set-url", i18n.G("<remote> <URL>"))
Expand All @@ -997,6 +1011,7 @@ func (c *cmdRemoteSetURL) Command() *cobra.Command {
return cmd
}

// Run is used in the RunE field of the cobra.Command returned by Command.
func (c *cmdRemoteSetURL) Run(cmd *cobra.Command, args []string) error {
conf := c.global.conf

Expand Down
2 changes: 1 addition & 1 deletion cmd/incusd/api_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ func clusterPutJoin(d *Daemon, r *http.Request, req api.ClusterPut) response.Res

return nil
})
if err != nil && err.Error() != "This certificate already exists" {
if err != nil && !api.StatusErrorCheck(err, http.StatusConflict) {
return fmt.Errorf("Failed adding local trusted certificate %q (%s): %w", trustedCert.Name, trustedCert.Fingerprint, err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/incusd/api_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ func internalImportFromBackup(ctx context.Context, s *state.State, projectName s

if backupConf.Pool == nil {
// We don't know what kind of storage type the pool is.
return fmt.Errorf(`No storage pool struct in the backup file found. The storage pool needs to be recovered manually`)
return fmt.Errorf("No storage pool struct in the backup file found. The storage pool needs to be recovered manually")
}

// Try to retrieve the storage pool the instance supposedly lives on.
Expand Down
2 changes: 1 addition & 1 deletion cmd/incusd/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -4548,7 +4548,7 @@ func autoSyncImages(ctx context.Context, s *state.State) error {
go func(projectName string, fingerprint string) {
err := imageSyncBetweenNodes(ctx, s, nil, projectName, fingerprint)
if err != nil {
logger.Error("Failed to synchronize images", logger.Ctx{"err": err, "fingerprint": fingerprint})
logger.Error("Failed to synchronize images", logger.Ctx{"err": err, "project": projectName, "fingerprint": fingerprint})
}

ch <- nil
Expand Down
2 changes: 1 addition & 1 deletion cmd/incusd/instances_post.go
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ func createFromBackup(s *state.State, r *http.Request, projectName string, data

inst, err := instance.LoadByProjectAndName(s, bInfo.Project, bInfo.Name)
if err != nil {
return fmt.Errorf("Load instance: %w", err)
return fmt.Errorf("Failed loading instance: %w", err)
}

// Clean up created instance if the post hook fails below.
Expand Down
2 changes: 1 addition & 1 deletion cmd/incusd/migrate_storage_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (s *migrationSourceWs) DoStorage(state *state.State, projectName string, po

volSourceArgs := &localMigration.VolumeSourceArgs{
IndexHeaderVersion: respHeader.GetIndexHeaderVersion(), // Enable index header frame if supported.
Name: volName,
Name: srcConfig.Volume.Name,
MigrationType: migrationTypes[0],
Snapshots: offerHeader.SnapshotNames,
TrackProgress: true,
Expand Down
28 changes: 20 additions & 8 deletions cmd/incusd/storage_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -808,22 +808,28 @@ func clusterCopyCustomVolumeInternal(s *state.State, r *http.Request, sourceAddr
}

func doCustomVolumeRefresh(s *state.State, r *http.Request, requestProjectName string, projectName string, poolName string, req *api.StorageVolumesPost) response.Response {
var run func(op *operations.Operation) error

pool, err := storagePools.LoadByName(s, poolName)
if err != nil {
return response.SmartError(err)
}

run = func(op *operations.Operation) error {
var srcProjectName string
if req.Source.Project != "" {
srcProjectName, err = project.StorageVolumeProject(s.DB.Cluster, req.Source.Project, db.StoragePoolVolumeTypeCustom)
if err != nil {
return response.SmartError(err)
}
}

run := func(op *operations.Operation) error {
revert := revert.New()
defer revert.Fail()

if req.Source.Name == "" {
return fmt.Errorf("No source volume name supplied")
}

err = pool.RefreshCustomVolume(projectName, req.Source.Project, req.Name, req.Description, req.Config, req.Source.Pool, req.Source.Name, !req.Source.VolumeOnly, op)
err = pool.RefreshCustomVolume(projectName, srcProjectName, req.Name, req.Description, req.Config, req.Source.Pool, req.Source.Name, !req.Source.VolumeOnly, op)
if err != nil {
return err
}
Expand All @@ -841,13 +847,19 @@ func doCustomVolumeRefresh(s *state.State, r *http.Request, requestProjectName s
}

func doVolumeCreateOrCopy(s *state.State, r *http.Request, requestProjectName string, projectName string, poolName string, req *api.StorageVolumesPost) response.Response {
var run func(op *operations.Operation) error

pool, err := storagePools.LoadByName(s, poolName)
if err != nil {
return response.SmartError(err)
}

var srcProjectName string
if req.Source.Project != "" {
srcProjectName, err = project.StorageVolumeProject(s.DB.Cluster, req.Source.Project, db.StoragePoolVolumeTypeCustom)
if err != nil {
return response.SmartError(err)
}
}

volumeDBContentType, err := storagePools.VolumeContentTypeNameToContentType(req.ContentType)
if err != nil {
return response.SmartError(err)
Expand All @@ -858,15 +870,15 @@ func doVolumeCreateOrCopy(s *state.State, r *http.Request, requestProjectName st
return response.SmartError(err)
}

run = func(op *operations.Operation) error {
run := func(op *operations.Operation) error {
if req.Source.Name == "" {
// Use an empty operation for this sync response to pass the requestor
op := &operations.Operation{}
op.SetRequestor(r)
return pool.CreateCustomVolume(projectName, req.Name, req.Description, req.Config, contentType, op)
}

return pool.CreateCustomVolumeFromCopy(projectName, req.Source.Project, req.Name, req.Description, req.Config, req.Source.Pool, req.Source.Name, !req.Source.VolumeOnly, op)
return pool.CreateCustomVolumeFromCopy(projectName, srcProjectName, req.Name, req.Description, req.Config, req.Source.Pool, req.Source.Name, !req.Source.VolumeOnly, op)
}

// If no source name supplied then this a volume create operation.
Expand Down
1 change: 1 addition & 0 deletions doc/.sphinx/spellingcheck.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
jobs: 2
matrix:
- name: Markdown files
aspell:
Expand Down
11 changes: 11 additions & 0 deletions doc/howto/images_manage.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ To edit the full image properties, including the top-level properties, enter the

incus image edit <image_ID>

## Delete an image

To delete a local copy of an image, enter the following command:

incus image delete <image_ID>

Deleting an image won't affect running instances that are already using it, but it will remove the image locally.

After deletion, if the image was downloaded from a remote server, it will be removed from local cache and downloaded again on next use.
However, if the image was manually created (not cached), the image will be deleted.

## Configure image aliases

Configuring an alias for an image can be useful to make it easier to refer to an image, since remembering an alias is usually easier than remembering a fingerprint.
Expand Down
2 changes: 1 addition & 1 deletion doc/howto/storage_backup_volume.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ You can restore a custom storage volume to the state of any of its snapshots.
To do so, you must first stop all instances that use the storage volume.
Then use the following command:

incus storage volume restore <pool_name> <volume_name> <snapshot_name>
incus storage volume snapshot restore <pool_name> <volume_name> <snapshot_name>

You can also restore a snapshot into a new custom storage volume, either in the same storage pool or in a different one (even a remote storage pool).
To do so, use the following command:
Expand Down
4 changes: 2 additions & 2 deletions doc/reference/instance_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Limiting huge pages is done through the `hugetlb` cgroup controller, which means
(instance-options-limits-kernel)=
### Kernel resource limits

Incus exposes a generic namespaced key `limits.kernel.*` that can be used to set resource limits for an instance.
For container instances, Incus exposes a generic namespaced key `limits.kernel.*` that can be used to set resource limits.

It is generic in the sense that Incus does not perform any validation on the resource that is specified following the `limits.kernel.*` prefix.
Incus cannot know about all the possible resources that a given kernel supports.
Expand All @@ -197,7 +197,7 @@ For example, `RLIMIT_NOFILE` should be specified as `nofile`.
A limit is specified as two colon-separated values that are either numeric or the word `unlimited` (for example, `limits.kernel.nofile=1000:2000`).
A single value can be used as a shortcut to set both soft and hard limit to the same value (for example, `limits.kernel.nofile=3000`).

A resource with no explicitly configured limit will inherit its limit from the process that starts up the instance.
A resource with no explicitly configured limit will inherit its limit from the process that starts up the container.
Note that this inheritance is not enforced by Incus but by the kernel.

(instance-options-migration)=
Expand Down
Loading
Loading