mirror of https://github.com/apache/cloudstack.git
make setting non-dynamic & fix test
This commit is contained in:
parent
7a11626c34
commit
82d6edd4bb
|
|
@ -141,6 +141,9 @@ public class DefaultHostListener implements HypervisorHostListener {
|
|||
|
||||
Optional.ofNullable(nfsMountOpts).ifPresent(detailsMap::putAll);
|
||||
|
||||
// Propagate CLVM secure zero-fill setting to the host
|
||||
// Note: This is done during host connection (agent start, MS restart, host reconnection)
|
||||
// so the setting is non-dynamic. Changes require host reconnection to take effect.
|
||||
if (pool.getPoolType() == Storage.StoragePoolType.CLVM) {
|
||||
Boolean clvmSecureZeroFill = VolumeApiServiceImpl.CLVMSecureZeroFill.valueIn(poolId);
|
||||
if (clvmSecureZeroFill != null) {
|
||||
|
|
|
|||
|
|
@ -2728,8 +2728,11 @@ public class LibvirtComputingResourceTest {
|
|||
|
||||
@Test
|
||||
public void testModifyStoragePoolCommand() {
|
||||
final StoragePool pool = Mockito.mock(StoragePool.class);;
|
||||
final StoragePool pool = Mockito.mock(StoragePool.class);
|
||||
final ModifyStoragePoolCommand command = new ModifyStoragePoolCommand(true, pool);
|
||||
Map<String, String> details = new HashMap<>();
|
||||
details.put(KVMStoragePool.CLVM_SECURE_ZERO_FILL, "false");
|
||||
command.setDetails(details);
|
||||
|
||||
final KVMStoragePoolManager storagePoolMgr = Mockito.mock(KVMStoragePoolManager.class);
|
||||
final KVMStoragePool kvmStoragePool = Mockito.mock(KVMStoragePool.class);
|
||||
|
|
@ -2753,8 +2756,11 @@ public class LibvirtComputingResourceTest {
|
|||
|
||||
@Test
|
||||
public void testModifyStoragePoolCommandFailure() {
|
||||
final StoragePool pool = Mockito.mock(StoragePool.class);;
|
||||
final StoragePool pool = Mockito.mock(StoragePool.class);
|
||||
final ModifyStoragePoolCommand command = new ModifyStoragePoolCommand(true, pool);
|
||||
Map<String, String> details = new HashMap<>();
|
||||
details.put(KVMStoragePool.CLVM_SECURE_ZERO_FILL, "false");
|
||||
command.setDetails(details);
|
||||
|
||||
final KVMStoragePoolManager storagePoolMgr = Mockito.mock(KVMStoragePoolManager.class);
|
||||
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
|
|||
"To check and repair the volume if it has any leaks before performing volume attach or VM start operations", true, ConfigKey.Scope.StoragePool);
|
||||
|
||||
public static final ConfigKey<Boolean> CLVMSecureZeroFill = new ConfigKey<>("Advanced", Boolean.class, "clvm.secure.zero.fill", "false",
|
||||
"When enabled, CLVM volumes to be zero-filled at the time of deletion to prevent data from being recovered by VMs reusing the space, as thick LVM volumes write data linearly", true, ConfigKey.Scope.StoragePool);
|
||||
"When enabled, CLVM volumes to be zero-filled at the time of deletion to prevent data from being recovered by VMs reusing the space, as thick LVM volumes write data linearly. Note: This setting is propagated to hosts when they connect to the storage pool. Changing this setting requires disconnecting and reconnecting hosts or restarting the KVM agent for it to take effect.", false, ConfigKey.Scope.StoragePool);
|
||||
|
||||
private final StateMachine2<Volume.State, Volume.Event, Volume> _volStateMachine;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue