diff --git a/lxd/storage/drivers/driver_ceph_volumes.go b/lxd/storage/drivers/driver_ceph_volumes.go index 93cc5b25e477..e777faf40398 100644 --- a/lxd/storage/drivers/driver_ceph_volumes.go +++ b/lxd/storage/drivers/driver_ceph_volumes.go @@ -805,15 +805,20 @@ func (d *ceph) FillVolumeConfig(vol Volume) error { // Only validate filesystem config keys for filesystem volumes or VM block volumes (which have an // associated filesystem volume). if vol.ContentType() == ContentTypeFS || vol.IsVMBlock() { - // Inherit filesystem from pool if not set. - if vol.config["block.filesystem"] == "" { - vol.config["block.filesystem"] = d.config["volume.block.filesystem"] - } - - // Default filesystem if neither volume nor pool specify an override. - if vol.config["block.filesystem"] == "" { - // Unchangeable volume property: Set unconditionally. + // VM volumes will always use the default filesystem. + if vol.IsVMBlock() { vol.config["block.filesystem"] = DefaultFilesystem + } else { + // Inherit filesystem from pool if not set. + if vol.config["block.filesystem"] == "" { + vol.config["block.filesystem"] = d.config["volume.block.filesystem"] + } + + // Default filesystem if neither volume nor pool specify an override. + if vol.config["block.filesystem"] == "" { + // Unchangeable volume property: Set unconditionally. + vol.config["block.filesystem"] = DefaultFilesystem + } } // Inherit filesystem mount options from pool if not set. diff --git a/lxd/storage/drivers/driver_lvm_volumes.go b/lxd/storage/drivers/driver_lvm_volumes.go index 5a3becaf0ff3..ee5b9d8122b0 100644 --- a/lxd/storage/drivers/driver_lvm_volumes.go +++ b/lxd/storage/drivers/driver_lvm_volumes.go @@ -257,15 +257,20 @@ func (d *lvm) FillVolumeConfig(vol Volume) error { // Only validate filesystem config keys for filesystem volumes or VM block volumes (which have an // associated filesystem volume). if vol.ContentType() == ContentTypeFS || vol.IsVMBlock() { - // Inherit filesystem from pool if not set. - if vol.config["block.filesystem"] == "" { - vol.config["block.filesystem"] = d.config["volume.block.filesystem"] - } - - // Default filesystem if neither volume nor pool specify an override. - if vol.config["block.filesystem"] == "" { - // Unchangeable volume property: Set unconditionally. + // VM volumes will always use the default filesystem. + if vol.IsVMBlock() { vol.config["block.filesystem"] = DefaultFilesystem + } else { + // Inherit filesystem from pool if not set. + if vol.config["block.filesystem"] == "" { + vol.config["block.filesystem"] = d.config["volume.block.filesystem"] + } + + // Default filesystem if neither volume nor pool specify an override. + if vol.config["block.filesystem"] == "" { + // Unchangeable volume property: Set unconditionally. + vol.config["block.filesystem"] = DefaultFilesystem + } } // Inherit filesystem mount options from pool if not set. diff --git a/lxd/storage/drivers/driver_powerflex_volumes.go b/lxd/storage/drivers/driver_powerflex_volumes.go index 63deeb277aa8..fe0764452876 100644 --- a/lxd/storage/drivers/driver_powerflex_volumes.go +++ b/lxd/storage/drivers/driver_powerflex_volumes.go @@ -385,15 +385,20 @@ func (d *powerflex) FillVolumeConfig(vol Volume) error { // Only validate filesystem config keys for filesystem volumes or VM block volumes (which have an // associated filesystem volume). if vol.ContentType() == ContentTypeFS || vol.IsVMBlock() { - // Inherit filesystem from pool if not set. - if vol.config["block.filesystem"] == "" { - vol.config["block.filesystem"] = d.config["volume.block.filesystem"] - } - - // Default filesystem if neither volume nor pool specify an override. - if vol.config["block.filesystem"] == "" { - // Unchangeable volume property: Set unconditionally. + // VM volumes will always use the default filesystem. + if vol.IsVMBlock() { vol.config["block.filesystem"] = DefaultFilesystem + } else { + // Inherit filesystem from pool if not set. + if vol.config["block.filesystem"] == "" { + vol.config["block.filesystem"] = d.config["volume.block.filesystem"] + } + + // Default filesystem if neither volume nor pool specify an override. + if vol.config["block.filesystem"] == "" { + // Unchangeable volume property: Set unconditionally. + vol.config["block.filesystem"] = DefaultFilesystem + } } // Inherit filesystem mount options from pool if not set.