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 #291

Merged
merged 7 commits into from
Dec 9, 2023
6 changes: 5 additions & 1 deletion cmd/incus-agent/api_1.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion doc/cloud-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ config:
```

```{tip}
See {doc}`How to validate user data cloud configuration <cloud-init:howto/debug_user_data>` for information on how to check whether the syntax is correct.
See {ref}`How to validate user data <cloud-init:check_user_data_cloud_config>` for information on how to check whether the syntax is correct.
```

## How to check the `cloud-init` status
Expand Down
8 changes: 7 additions & 1 deletion internal/server/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
}
Expand Down
23 changes: 13 additions & 10 deletions internal/server/storage/drivers/driver_ceph_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/server/storage/s3/miniod/miniod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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_"
Expand Down
Loading