diff --git a/cmd/incus-agent/api_1.0.go b/cmd/incus-agent/api_1.0.go index 470b2af5b63..4bfd214cfa7 100644 --- a/cmd/incus-agent/api_1.0.go +++ b/cmd/incus-agent/api_1.0.go @@ -171,7 +171,11 @@ func stopDevIncusServer(d *Daemon) error { d.DevIncusRunning = false d.DevIncusMu.Unlock() - return servers["DevIncus"].Close() + if servers["DevIncus"] != nil { + return servers["DevIncus"].Close() + } + + return nil } func getClient(CID uint32, port int, serverCertificate string) (*http.Client, error) { diff --git a/doc/cloud-init.md b/doc/cloud-init.md index a4384905939..3984deeabed 100644 --- a/doc/cloud-init.md +++ b/doc/cloud-init.md @@ -88,7 +88,7 @@ config: ``` ```{tip} -See {doc}`How to validate user data cloud configuration ` for information on how to check whether the syntax is correct. +See {ref}`How to validate user data ` for information on how to check whether the syntax is correct. ``` ## How to check the `cloud-init` status diff --git a/internal/server/instance/drivers/driver_qemu.go b/internal/server/instance/drivers/driver_qemu.go index da5efaa797b..55751f8ad34 100644 --- a/internal/server/instance/drivers/driver_qemu.go +++ b/internal/server/instance/drivers/driver_qemu.go @@ -1044,7 +1044,13 @@ func (d *qemu) validateStartup(stateful bool, statusCode api.StatusCode) error { return err } - stateDiskSizeStr := d.storagePool.Driver().Info().DefaultVMBlockFilesystemSize + // Don't access d.storagePool directly since it isn't populated at this stage. + pool, err := d.getStoragePool() + if err != nil { + return err + } + + stateDiskSizeStr := pool.Driver().Info().DefaultVMBlockFilesystemSize if rootDiskDevice["size.state"] != "" { stateDiskSizeStr = rootDiskDevice["size.state"] } diff --git a/internal/server/storage/drivers/driver_ceph_volumes.go b/internal/server/storage/drivers/driver_ceph_volumes.go index 9fabec4d85b..587e5aaee4e 100644 --- a/internal/server/storage/drivers/driver_ceph_volumes.go +++ b/internal/server/storage/drivers/driver_ceph_volumes.go @@ -364,6 +364,19 @@ func (d *ceph) CreateVolumeFromCopy(vol Volume, srcVol Volume, copySnapshots boo return nil } + // For VMs, also copy the filesystem volume. + if vol.IsVMBlock() { + srcFSVol := srcVol.NewVMBlockFilesystemVolume() + fsVol := vol.NewVMBlockFilesystemVolume() + err := d.CreateVolumeFromCopy(fsVol, srcFSVol, copySnapshots, false, op) + if err != nil { + return err + } + + // Delete on revert. + revert.Add(func() { _ = d.DeleteVolume(fsVol, op) }) + } + // Retrieve snapshots on the source. snapshots := []string{} if !srcVol.IsSnapshot() && copySnapshots { @@ -433,16 +446,6 @@ func (d *ceph) CreateVolumeFromCopy(vol Volume, srcVol Volume, copySnapshots boo revert.Add(func() { _ = d.DeleteVolume(vol, op) }) } - // For VMs, also copy the filesystem volume. - if vol.IsVMBlock() { - srcFSVol := srcVol.NewVMBlockFilesystemVolume() - fsVol := vol.NewVMBlockFilesystemVolume() - err := d.CreateVolumeFromCopy(fsVol, srcFSVol, false, false, op) - if err != nil { - return err - } - } - err = postCreateTasks(vol) if err != nil { return err diff --git a/internal/server/storage/s3/miniod/miniod.go b/internal/server/storage/s3/miniod/miniod.go index f78b38a1cd0..9c3807dcec2 100644 --- a/internal/server/storage/s3/miniod/miniod.go +++ b/internal/server/storage/s3/miniod/miniod.go @@ -30,7 +30,7 @@ import ( ) // minioHost is the host address that the local MinIO processes will listen on. -const minioHost = "[::1]" +const minioHost = "127.0.0.1" // minioLockPrefix is the prefix used for per-bucket MinIO spawn lock. const minioLockPrefix = "minio_"