Skip to content

Commit 6931d1b

Browse files
committed
Merge branch '4.19' of https://github.com/apache/cloudstack into go-sdk-response-obj
2 parents b5a0842 + 5c01cff commit 6931d1b

File tree

35 files changed

+192
-83
lines changed

35 files changed

+192
-83
lines changed

api/src/main/java/com/cloud/vm/VmDetailConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public interface VmDetailConstants {
7373
String ENCRYPTED_PASSWORD = "Encrypted.Password";
7474

7575
String CONFIG_DRIVE_LOCATION = "configDriveLocation";
76+
String LAST_CONFIG_DRIVE_LOCATION = "lastConfigDriveLocation";
7677

7778
String SKIP_DRS = "skipFromDRS";
7879

engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.cloud.agent.api.Command;
4747
import com.cloud.agent.api.CreateStoragePoolCommand;
4848
import com.cloud.agent.api.DeleteStoragePoolCommand;
49+
import com.cloud.agent.api.HandleConfigDriveIsoCommand;
4950
import com.cloud.agent.api.MaintainCommand;
5051
import com.cloud.agent.api.MigrateCommand;
5152
import com.cloud.agent.api.ModifySshKeysCommand;
@@ -119,11 +120,10 @@ public int compare(final Object o1, final Object o2) {
119120

120121
public final static String[] s_commandsAllowedInMaintenanceMode = new String[] { MaintainCommand.class.toString(), MigrateCommand.class.toString(),
121122
StopCommand.class.toString(), CheckVirtualMachineCommand.class.toString(), PingTestCommand.class.toString(), CheckHealthCommand.class.toString(),
122-
ReadyCommand.class.toString(), ShutdownCommand.class.toString(), SetupCommand.class.toString(),
123-
CleanupNetworkRulesCmd.class.toString(), CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString(), CheckOnHostCommand.class.toString(),
124-
ModifyTargetsCommand.class.toString(), ModifySshKeysCommand.class.toString(),
125-
CreateStoragePoolCommand.class.toString(), DeleteStoragePoolCommand.class.toString(), ModifyStoragePoolCommand.class.toString(),
126-
SetupMSListCommand.class.toString(), RollingMaintenanceCommand.class.toString(), CleanupPersistentNetworkResourceCommand.class.toString()};
123+
ReadyCommand.class.toString(), ShutdownCommand.class.toString(), SetupCommand.class.toString(), CleanupNetworkRulesCmd.class.toString(),
124+
CheckNetworkCommand.class.toString(), PvlanSetupCommand.class.toString(), CheckOnHostCommand.class.toString(), ModifyTargetsCommand.class.toString(),
125+
ModifySshKeysCommand.class.toString(), CreateStoragePoolCommand.class.toString(), DeleteStoragePoolCommand.class.toString(), ModifyStoragePoolCommand.class.toString(),
126+
SetupMSListCommand.class.toString(), RollingMaintenanceCommand.class.toString(), CleanupPersistentNetworkResourceCommand.class.toString(), HandleConfigDriveIsoCommand.class.toString()};
127127
protected final static String[] s_commandsNotAllowedInConnectingMode = new String[] { StartCommand.class.toString(), CreateCommand.class.toString() };
128128
static {
129129
Arrays.sort(s_commandsAllowedInMaintenanceMode);

packaging/centos7/cloud.spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/lib
261261
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup
262262
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/management
263263
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management
264+
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/systemd/system/%{name}-management.service.d
264265
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/run
265266
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel
266267

@@ -309,6 +310,7 @@ install -D utils/target/cloud-utils-%{_maventag}-bundled.jar ${RPM_BUILD_ROOT}%{
309310

310311
install -D packaging/centos7/cloud-ipallocator.rc ${RPM_BUILD_ROOT}%{_initrddir}/%{name}-ipallocator
311312
install -D packaging/centos7/cloud.limits ${RPM_BUILD_ROOT}%{_sysconfdir}/security/limits.d/cloud
313+
install -D packaging/centos7/filelimit.conf ${RPM_BUILD_ROOT}%{_sysconfdir}/systemd/system/%{name}-management.service.d
312314
install -D packaging/systemd/cloudstack-management.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-management.service
313315
install -D packaging/systemd/cloudstack-management.default ${RPM_BUILD_ROOT}%{_sysconfdir}/default/%{name}-management
314316
install -D server/target/conf/cloudstack-sudoers ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
@@ -591,6 +593,7 @@ pip3 install --upgrade urllib3
591593
%config(noreplace) %{_sysconfdir}/default/%{name}-management
592594
%config(noreplace) %{_sysconfdir}/sudoers.d/%{name}-management
593595
%config(noreplace) %{_sysconfdir}/security/limits.d/cloud
596+
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}-management.service.d
594597
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/db.properties
595598
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/server.properties
596599
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/config.json

packaging/centos7/filelimit.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# should go in /etc/systemd/system/cloudstack-management.service.d/
19+
[Service]
20+
LimitNPROC=infinity

packaging/centos8/cloud.spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/lib
243243
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup
244244
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}/management
245245
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/management
246+
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/systemd/system/%{name}-management.service.d
246247
mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/run
247248
mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/%{name}-management/setup/wheel
248249

@@ -291,6 +292,7 @@ install -D utils/target/cloud-utils-%{_maventag}-bundled.jar ${RPM_BUILD_ROOT}%{
291292

292293
install -D packaging/centos8/cloud-ipallocator.rc ${RPM_BUILD_ROOT}%{_initrddir}/%{name}-ipallocator
293294
install -D packaging/centos8/cloud.limits ${RPM_BUILD_ROOT}%{_sysconfdir}/security/limits.d/cloud
295+
install -D packaging/centos8/filelimit.conf ${RPM_BUILD_ROOT}%{_sysconfdir}/systemd/system/%{name}-management.service.d
294296
install -D packaging/systemd/cloudstack-management.service ${RPM_BUILD_ROOT}%{_unitdir}/%{name}-management.service
295297
install -D packaging/systemd/cloudstack-management.default ${RPM_BUILD_ROOT}%{_sysconfdir}/default/%{name}-management
296298
install -D server/target/conf/cloudstack-sudoers ${RPM_BUILD_ROOT}%{_sysconfdir}/sudoers.d/%{name}-management
@@ -570,6 +572,7 @@ pip install --upgrade /usr/share/cloudstack-marvin/Marvin-*.tar.gz
570572
%config(noreplace) %{_sysconfdir}/default/%{name}-management
571573
%config(noreplace) %{_sysconfdir}/sudoers.d/%{name}-management
572574
%config(noreplace) %{_sysconfdir}/security/limits.d/cloud
575+
%config(noreplace) %{_sysconfdir}/systemd/system/%{name}-management.service.d
573576
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/db.properties
574577
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/server.properties
575578
%config(noreplace) %attr(0640,root,cloud) %{_sysconfdir}/%{name}/management/config.json

packaging/centos8/filelimit.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
# should go in /etc/systemd/system/cloudstack-management.service.d/
19+
[Service]
20+
LimitNPROC=infinity

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,9 +2985,10 @@ public String getVolumePath(final Connect conn, final DiskTO volume, boolean dis
29852985

29862986
public static boolean useBLOCKDiskType(KVMPhysicalDisk physicalDisk) {
29872987
return physicalDisk != null &&
2988-
physicalDisk.getPool().getType() == StoragePoolType.Linstor &&
2988+
physicalDisk.getPool() != null &&
2989+
StoragePoolType.Linstor.equals(physicalDisk.getPool().getType()) &&
29892990
physicalDisk.getFormat() != null &&
2990-
physicalDisk.getFormat()== PhysicalDiskFormat.RAW;
2991+
PhysicalDiskFormat.RAW.equals(physicalDisk.getFormat());
29912992
}
29922993

29932994
public static DiskDef.DiskType getDiskType(KVMPhysicalDisk physicalDisk) {
@@ -3402,13 +3403,15 @@ public void detachAndAttachConfigDriveISO(final Connect conn, final String vmNam
34023403
}
34033404
if (configdrive != null) {
34043405
try {
3406+
s_logger.debug(String.format("Detaching ConfigDrive ISO of the VM %s, at path %s", vmName, configdrive.getDiskPath()));
34053407
String result = attachOrDetachISO(conn, vmName, configdrive.getDiskPath(), false, CONFIG_DRIVE_ISO_DEVICE_ID);
34063408
if (result != null) {
3407-
s_logger.warn("Detach ConfigDrive ISO with result: " + result);
3409+
s_logger.warn(String.format("Detach ConfigDrive ISO of the VM %s, at path %s with %s: ", vmName, configdrive.getDiskPath(), result));
34083410
}
3411+
s_logger.debug(String.format("Attaching ConfigDrive ISO of the VM %s, at path %s", vmName, configdrive.getDiskPath()));
34093412
result = attachOrDetachISO(conn, vmName, configdrive.getDiskPath(), true, CONFIG_DRIVE_ISO_DEVICE_ID);
34103413
if (result != null) {
3411-
s_logger.warn("Attach ConfigDrive ISO with result: " + result);
3414+
s_logger.warn(String.format("Attach ConfigDrive ISO of the VM %s, at path %s with %s: ", vmName, configdrive.getDiskPath(), result));
34123415
}
34133416
} catch (final LibvirtException | InternalErrorException | URISyntaxException e) {
34143417
final String msg = "Detach and attach ConfigDrive ISO failed due to " + e.toString();
@@ -3420,16 +3423,20 @@ public void detachAndAttachConfigDriveISO(final Connect conn, final String vmNam
34203423
public synchronized String attachOrDetachISO(final Connect conn, final String vmName, String isoPath, final boolean isAttach, final Integer diskSeq) throws LibvirtException, URISyntaxException,
34213424
InternalErrorException {
34223425
final DiskDef iso = new DiskDef();
3423-
if (isoPath != null && isAttach) {
3424-
final int index = isoPath.lastIndexOf("/");
3425-
final String path = isoPath.substring(0, index);
3426-
final String name = isoPath.substring(index + 1);
3427-
final KVMStoragePool secondaryPool = storagePoolManager.getStoragePoolByURI(path);
3428-
final KVMPhysicalDisk isoVol = secondaryPool.getPhysicalDisk(name);
3429-
final DiskDef.DiskType diskType = getDiskType(isoVol);
3430-
isoPath = isoVol.getPath();
3431-
3432-
iso.defISODisk(isoPath, diskSeq, diskType);
3426+
if (isAttach && StringUtils.isNotBlank(isoPath) && isoPath.lastIndexOf("/") > 0) {
3427+
if (isoPath.startsWith(getConfigPath() + "/" + ConfigDrive.CONFIGDRIVEDIR) && isoPath.contains(vmName)) {
3428+
iso.defISODisk(isoPath, diskSeq, DiskDef.DiskType.FILE);
3429+
} else {
3430+
final int index = isoPath.lastIndexOf("/");
3431+
final String path = isoPath.substring(0, index);
3432+
final String name = isoPath.substring(index + 1);
3433+
final KVMStoragePool storagePool = storagePoolManager.getStoragePoolByURI(path);
3434+
final KVMPhysicalDisk isoVol = storagePool.getPhysicalDisk(name);
3435+
final DiskDef.DiskType diskType = getDiskType(isoVol);
3436+
isoPath = isoVol.getPath();
3437+
3438+
iso.defISODisk(isoPath, diskSeq, diskType);
3439+
}
34333440
} else {
34343441
iso.defISODisk(null, diskSeq, DiskDef.DiskType.FILE);
34353442
}

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtGetVmIpAddressCommandWrapper.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ public Answer execute(final GetVmIpAddressCommand command, final LibvirtComputin
4242
String ip = null;
4343
boolean result = false;
4444
String vmName = command.getVmName();
45+
if (!NetUtils.verifyDomainNameLabel(vmName, true)) {
46+
return new Answer(command, result, ip);
47+
}
4548
String sanitizedVmName = sanitizeBashCommandArgument(vmName);
4649
String networkCidr = command.getVmNetworkCidr();
4750
List<String[]> commands = new ArrayList<>();

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtPrepareForMigrationCommandWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public Answer execute(final PrepareForMigrationCommand command, final LibvirtCom
120120

121121
skipDisconnect = true;
122122

123-
if (!storagePoolMgr.connectPhysicalDisksViaVmSpec(vm)) {
123+
if (!storagePoolMgr.connectPhysicalDisksViaVmSpec(vm, true)) {
124124
return new PrepareForMigrationAnswer(command, "failed to connect physical disks to host");
125125
}
126126

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtSetupDirectDownloadCertificateCommandWrapper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.cloud.utils.FileUtil;
3838
import com.cloud.utils.PropertiesUtil;
3939
import com.cloud.utils.exception.CloudRuntimeException;
40+
import com.cloud.utils.net.NetUtils;
4041
import com.cloud.utils.script.Script;
4142

4243
@ResourceWrapper(handles = SetupDirectDownloadCertificateCommand.class)
@@ -132,6 +133,9 @@ protected void cleanupTemporaryFile(String temporaryFile) {
132133
public Answer execute(SetupDirectDownloadCertificateCommand cmd, LibvirtComputingResource serverResource) {
133134
String certificate = cmd.getCertificate();
134135
String certificateName = cmd.getCertificateName();
136+
if (!NetUtils.verifyDomainNameLabel(certificateName, false)) {
137+
return new Answer(cmd, false, "The provided certificate name is invalid");
138+
}
135139

136140
try {
137141
File agentFile = getAgentPropertiesFile();

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtStartCommandWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Answer execute(final StartCommand command, final LibvirtComputingResource
7777

7878
libvirtComputingResource.createVbd(conn, vmSpec, vmName, vm);
7979

80-
if (!storagePoolMgr.connectPhysicalDisksViaVmSpec(vmSpec)) {
80+
if (!storagePoolMgr.connectPhysicalDisksViaVmSpec(vmSpec, false)) {
8181
return new StartAnswer(command, "Failed to connect physical disks to host");
8282
}
8383

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/IscsiAdmStorageAdaptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public KVMPhysicalDisk createPhysicalDisk(String volumeUuid, KVMStoragePool pool
7979
}
8080

8181
@Override
82-
public boolean connectPhysicalDisk(String volumeUuid, KVMStoragePool pool, Map<String, String> details) {
82+
public boolean connectPhysicalDisk(String volumeUuid, KVMStoragePool pool, Map<String, String> details, boolean isVMMigrate) {
8383
// ex. sudo iscsiadm -m node -T iqn.2012-03.com.test:volume1 -p 192.168.233.10:3260 -o new
8484
Script iScsiAdmCmd = new Script(true, "iscsiadm", 0, s_logger);
8585

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/IscsiAdmStoragePool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public KVMPhysicalDisk createPhysicalDisk(String name, Storage.ProvisioningType
106106

107107
@Override
108108
public boolean connectPhysicalDisk(String name, Map<String, String> details) {
109-
return this._storageAdaptor.connectPhysicalDisk(name, this, details);
109+
return this._storageAdaptor.connectPhysicalDisk(name, this, details, false);
110110
}
111111

112112
@Override

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ public boolean connectPhysicalDisk(StoragePoolType type, String poolUuid, String
133133
StorageAdaptor adaptor = getStorageAdaptor(type);
134134
KVMStoragePool pool = adaptor.getStoragePool(poolUuid);
135135

136-
return adaptor.connectPhysicalDisk(volPath, pool, details);
136+
return adaptor.connectPhysicalDisk(volPath, pool, details, false);
137137
}
138138

139-
public boolean connectPhysicalDisksViaVmSpec(VirtualMachineTO vmSpec) {
139+
public boolean connectPhysicalDisksViaVmSpec(VirtualMachineTO vmSpec, boolean isVMMigrate) {
140140
boolean result = false;
141141

142142
final String vmName = vmSpec.getName();
@@ -159,7 +159,7 @@ public boolean connectPhysicalDisksViaVmSpec(VirtualMachineTO vmSpec) {
159159
KVMStoragePool pool = getStoragePool(store.getPoolType(), store.getUuid());
160160
StorageAdaptor adaptor = getStorageAdaptor(pool.getType());
161161

162-
result = adaptor.connectPhysicalDisk(vol.getPath(), pool, disk.getDetails());
162+
result = adaptor.connectPhysicalDisk(vol.getPath(), pool, disk.getDetails(), isVMMigrate);
163163

164164
if (!result) {
165165
s_logger.error("Failed to connect disks via vm spec for vm: " + vmName + " volume:" + vol.toString());
@@ -287,6 +287,7 @@ public KVMStoragePool getStoragePoolByURI(String uri) {
287287
URI storageUri = null;
288288

289289
try {
290+
s_logger.debug("Get storage pool by uri: " + uri);
290291
storageUri = new URI(uri);
291292
} catch (URISyntaxException e) {
292293
throw new CloudRuntimeException(e.toString());
@@ -296,7 +297,7 @@ public KVMStoragePool getStoragePoolByURI(String uri) {
296297
String uuid = null;
297298
String sourceHost = "";
298299
StoragePoolType protocol = null;
299-
final String scheme = storageUri.getScheme().toLowerCase();
300+
final String scheme = (storageUri.getScheme() != null) ? storageUri.getScheme().toLowerCase() : "";
300301
List<String> acceptedSchemes = List.of("nfs", "networkfilesystem", "filesystem");
301302
if (acceptedSchemes.contains(scheme)) {
302303
sourcePath = storageUri.getPath();

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ private KVMPhysicalDisk createPhysicalDiskByQemuImg(String name, KVMStoragePool
10111011
}
10121012

10131013
@Override
1014-
public boolean connectPhysicalDisk(String name, KVMStoragePool pool, Map<String, String> details) {
1014+
public boolean connectPhysicalDisk(String name, KVMStoragePool pool, Map<String, String> details, boolean isVMMigrate) {
10151015
// this is for managed storage that needs to prep disks prior to use
10161016
return true;
10171017
}

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/ManagedNfsStorageAdaptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public KVMPhysicalDisk createPhysicalDisk(String volumeUuid, KVMStoragePool pool
9393
* creates a nfs storage pool using libvirt
9494
*/
9595
@Override
96-
public boolean connectPhysicalDisk(String volumeUuid, KVMStoragePool pool, Map<String, String> details) {
96+
public boolean connectPhysicalDisk(String volumeUuid, KVMStoragePool pool, Map<String, String> details, boolean isVMMigrate) {
9797

9898
StoragePool sp = null;
9999
Connect conn = null;

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/MultipathSCSIAdapterBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public boolean deleteStoragePool(String uuid) {
181181
}
182182

183183
@Override
184-
public boolean connectPhysicalDisk(String volumePath, KVMStoragePool pool, Map<String, String> details) {
184+
public boolean connectPhysicalDisk(String volumePath, KVMStoragePool pool, Map<String, String> details, boolean isVMMigrate) {
185185
LOGGER.info("connectPhysicalDisk called for [" + volumePath + "]");
186186

187187
if (StringUtils.isEmpty(volumePath)) {

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/MultipathSCSIPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public KVMPhysicalDisk createPhysicalDisk(String arg0, PhysicalDiskFormat arg1,
7878

7979
@Override
8080
public boolean connectPhysicalDisk(String volumeUuid, Map<String, String> details) {
81-
return storageAdaptor.connectPhysicalDisk(volumeUuid, this, details);
81+
return storageAdaptor.connectPhysicalDisk(volumeUuid, this, details, false);
8282
}
8383

8484
@Override

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/ScaleIOStorageAdaptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, Qemu
178178
return null;
179179
}
180180

181-
if(!connectPhysicalDisk(name, pool, null)) {
181+
if(!connectPhysicalDisk(name, pool, null, false)) {
182182
throw new CloudRuntimeException(String.format("Failed to ensure disk %s was present", name));
183183
}
184184

@@ -221,7 +221,7 @@ public KVMPhysicalDisk createPhysicalDisk(String name, KVMStoragePool pool, Qemu
221221
}
222222

223223
@Override
224-
public boolean connectPhysicalDisk(String volumePath, KVMStoragePool pool, Map<String, String> details) {
224+
public boolean connectPhysicalDisk(String volumePath, KVMStoragePool pool, Map<String, String> details, boolean isMigration) {
225225
if (StringUtils.isEmpty(volumePath) || pool == null) {
226226
LOGGER.error("Unable to connect physical disk due to insufficient data");
227227
throw new CloudRuntimeException("Unable to connect physical disk due to insufficient data");

0 commit comments

Comments
 (0)