diff --git a/lxd/instance/drivers/driver_common.go b/lxd/instance/drivers/driver_common.go index 9406d169e0d8..1de1850473b3 100644 --- a/lxd/instance/drivers/driver_common.go +++ b/lxd/instance/drivers/driver_common.go @@ -1101,7 +1101,9 @@ func (d *common) canMigrate(inst instance.Instance) (migrate bool, live bool) { volatileGet := func() map[string]string { return map[string]string{} } volatileSet := func(_ map[string]string) error { return nil } for deviceName, rawConfig := range d.ExpandedDevices() { - dev, err := device.New(inst, d.state, deviceName, rawConfig, volatileGet, volatileSet) + // Make sure to clone the devices config for new devices. + // Some device drivers might modify the configuration and populate additional settings. + dev, err := device.New(inst, d.state, deviceName, rawConfig.Clone(), volatileGet, volatileSet) if err != nil { logger.Warn("Instance will not be migrated due to a device error", logger.Ctx{"project": inst.Project().Name, "instance": inst.Name(), "device": dev.Name(), "err": err}) return false, false