Skip to content

Commit c182c47

Browse files
authored
Merge branch '4.20' into fix-creatbksch-resp-annot
2 parents c7f07a3 + b394b5b commit c182c47

File tree

1,161 files changed

+10716
-7574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,161 files changed

+10716
-7574
lines changed

agent/src/main/java/com/cloud/agent/Agent.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,14 @@ public void doTask(final Task task) throws TaskExecutionException {
12281228
logger.error("Error parsing task", e);
12291229
}
12301230
} else if (task.getType() == Task.Type.DISCONNECT) {
1231-
logger.debug("Executing disconnect task - {}", () -> getLinkLog(task.getLink()));
1231+
try {
1232+
// an issue has been found if reconnect immediately after disconnecting.
1233+
// wait 5 seconds before reconnecting
1234+
logger.debug("Wait for 5 secs before reconnecting, disconnect task - {}", () -> getLinkLog(task.getLink()));
1235+
Thread.sleep(5000);
1236+
} catch (InterruptedException e) {
1237+
}
1238+
logger.debug("Executing disconnect task - {} and reconnecting", () -> getLinkLog(task.getLink()));
12321239
reconnect(task.getLink());
12331240
} else if (task.getType() == Task.Type.OTHER) {
12341241
processOtherTask(task);

agent/src/main/java/com/cloud/agent/resource/consoleproxy/ConsoleProxyResource.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,12 @@ private Answer executeProxyLoadScan(final Command cmd, final long proxyVmId, fin
175175
try {
176176
is.close();
177177
} catch (final IOException e) {
178-
logger.warn("Exception when closing , console proxy address : {}", proxyManagementIp);
178+
logger.warn("Exception when closing , console proxy address: {}", proxyManagementIp);
179179
success = false;
180180
}
181181
}
182182
} catch (final IOException e) {
183-
logger.warn("Unable to open console proxy command port url, console proxy address : {}", proxyManagementIp);
183+
logger.warn("Unable to open console proxy command port url, console proxy address: {}", proxyManagementIp);
184184
success = false;
185185
}
186186

api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,8 @@ private DatadiskTO generateDiskTO(OVFFile file, OVFDisk disk, String ovfParentPa
278278
if (StringUtils.isNotBlank(path)) {
279279
File f = new File(path);
280280
if (!f.exists() || f.isDirectory()) {
281-
logger.error("One of the attached disk or iso does not exists " + path);
282-
throw new InternalErrorException("One of the attached disk or iso as stated on OVF does not exists " + path);
281+
logger.error("One of the attached disk or ISO does not exists " + path);
282+
throw new InternalErrorException("One of the attached disk or ISO as stated on OVF does not exists " + path);
283283
}
284284
}
285285
Long capacity = disk != null ? disk._capacity : file._size;
@@ -335,7 +335,7 @@ protected List<OVFDisk> extractDisksFromOvfDocumentTree(Document doc) {
335335
vd.add(od);
336336
}
337337
if (logger.isTraceEnabled()) {
338-
logger.trace(String.format("found %d disk definitions",vd.size()));
338+
logger.trace(String.format("Found %d disk definitions", vd.size()));
339339
}
340340
return vd;
341341
}
@@ -367,7 +367,7 @@ protected List<OVFFile> extractFilesFromOvfDocumentTree(File ovfFile, Document d
367367
}
368368
}
369369
if (logger.isTraceEnabled()) {
370-
logger.trace(String.format("found %d file definitions in %s",vf.size(), ovfFile.getPath()));
370+
logger.trace(String.format("Found %d file definitions in %s", vf.size(), ovfFile.getPath()));
371371
}
372372
return vf;
373373
}
@@ -523,7 +523,7 @@ OVFFile getFileDefinitionFromDiskDefinition(String fileRef, List<OVFFile> files)
523523
public List<OVFNetworkTO> getNetPrerequisitesFromDocument(Document doc) throws InternalErrorException {
524524
if (doc == null) {
525525
if (logger.isTraceEnabled()) {
526-
logger.trace("no document to parse; returning no prerequisite networks");
526+
logger.trace("No document to parse; returning no prerequisite Networks");
527527
}
528528
return Collections.emptyList();
529529
}
@@ -541,7 +541,7 @@ private void matchNicsToNets(Map<String, OVFNetworkTO> nets, Node systemElement)
541541
final DocumentTraversal traversal = (DocumentTraversal) systemElement;
542542
final NodeIterator iterator = traversal.createNodeIterator(systemElement, NodeFilter.SHOW_ELEMENT, null, true);
543543
if (logger.isTraceEnabled()) {
544-
logger.trace(String.format("starting out with %d network-prerequisites, parsing hardware",nets.size()));
544+
logger.trace(String.format("Starting out with %d network-prerequisites, parsing hardware",nets.size()));
545545
}
546546
int nicCount = 0;
547547
for (Node n = iterator.nextNode(); n != null; n = iterator.nextNode()) {
@@ -551,7 +551,7 @@ private void matchNicsToNets(Map<String, OVFNetworkTO> nets, Node systemElement)
551551
String name = e.getTextContent(); // should be in our nets
552552
if(nets.get(name) == null) {
553553
if(logger.isInfoEnabled()) {
554-
logger.info(String.format("found a nic definition without a network definition byname %s, adding it to the list.", name));
554+
logger.info(String.format("Found a NIC definition without a Network definition by name %s, adding it to the list.", name));
555555
}
556556
nets.put(name, new OVFNetworkTO());
557557
}
@@ -562,7 +562,7 @@ private void matchNicsToNets(Map<String, OVFNetworkTO> nets, Node systemElement)
562562
}
563563
}
564564
if (logger.isTraceEnabled()) {
565-
logger.trace(String.format("ending up with %d network-prerequisites, parsed %d nics", nets.size(), nicCount));
565+
logger.trace(String.format("Ending up with %d network-prerequisites, parsed %d NICs", nets.size(), nicCount));
566566
}
567567
}
568568

@@ -631,7 +631,7 @@ private Map<String, OVFNetworkTO> getNetworksFromDocumentTree(Document doc) {
631631
nets.put(networkName,network);
632632
}
633633
if (logger.isTraceEnabled()) {
634-
logger.trace(String.format("found %d networks in template", nets.size()));
634+
logger.trace(String.format("Found %d Networks in Template", nets.size()));
635635
}
636636
return nets;
637637
}

api/src/main/java/com/cloud/api/commands/ListRecurringSnapshotScheduleCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public class ListRecurringSnapshotScheduleCmd extends BaseListCmd {
3535
//////////////// API parameters /////////////////////
3636
/////////////////////////////////////////////////////
3737

38-
@Parameter(name = ApiConstants.SNAPSHOT_POLICY_ID, type = CommandType.LONG, description = "lists recurring snapshots by snapshot policy ID")
38+
@Parameter(name = ApiConstants.SNAPSHOT_POLICY_ID, type = CommandType.LONG, description = "Lists recurring Snapshots by Snapshot policy ID")
3939
private Long snapshotPolicyId;
4040

41-
@Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.LONG, required = true, description = "list recurring snapshots by volume ID")
41+
@Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.LONG, required = true, description = "List recurring Snapshots by volume ID")
4242
private Long volumeId;
4343

4444
/////////////////////////////////////////////////////

api/src/main/java/com/cloud/network/Ipv6Service.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public interface Ipv6Service extends PluggableService, Configurable {
4545
static final ConfigKey<Boolean> Ipv6OfferingCreationEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class,
4646
"ipv6.offering.enabled",
4747
"false",
48-
"Indicates whether creation of IPv6 network/VPC offering is enabled or not.",
48+
"Indicates whether creation of IPv6 Network/VPC offering is enabled or not.",
4949
true);
5050

5151
static final ConfigKey<Integer> Ipv6PrefixSubnetCleanupInterval = new ConfigKey<Integer>("Advanced", Integer.class,

api/src/main/java/com/cloud/network/Network.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,9 @@ enum Event {
324324

325325
public enum State {
326326

327-
Allocated("Indicates the network configuration is in allocated but not setup"), Setup("Indicates the network configuration is setup"), Implementing(
328-
"Indicates the network configuration is being implemented"), Implemented("Indicates the network configuration is in use"), Shutdown(
329-
"Indicates the network configuration is being destroyed"), Destroy("Indicates that the network is destroyed");
327+
Allocated("Indicates the Network configuration is in allocated but not setup"), Setup("Indicates the Network configuration is setup"), Implementing(
328+
"Indicates the Network configuration is being implemented"), Implemented("Indicates the Network configuration is in use"), Shutdown(
329+
"Indicates the Network configuration is being destroyed"), Destroy("Indicates that the Network is destroyed");
330330

331331
protected static final StateMachine2<State, Network.Event, Network> s_fsm = new StateMachine2<State, Network.Event, Network>();
332332

api/src/main/java/com/cloud/network/NetworkService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public interface NetworkService {
8080
true, ConfigKey.Scope.Zone);
8181

8282
public static final ConfigKey<Boolean> AllowUsersToSpecifyVRMtu = new ConfigKey<>("Advanced", Boolean.class,
83-
"allow.end.users.to.specify.vr.mtu", "false", "Allow end users to specify VR MTU",
83+
"allow.end.users.to.specify.vr.mtu", "false", "Allow end Users to specify VR MTU",
8484
true, ConfigKey.Scope.Zone);
8585

8686
List<? extends Network> getIsolatedNetworksOwnedByAccountInZone(long zoneId, Account owner);

api/src/main/java/com/cloud/network/Networks.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public <T> URI toUri(T value) {
7878
}
7979
@Override
8080
public String getValueFrom(URI uri) {
81-
return uri.getAuthority();
81+
return uri == null ? null : uri.getAuthority();
8282
}
8383
},
8484
Vswitch("vs", String.class), LinkLocal(null, null), Vnet("vnet", Long.class), Storage("storage", Integer.class), Lswitch("lswitch", String.class) {
@@ -96,7 +96,7 @@ public <T> URI toUri(T value) {
9696
*/
9797
@Override
9898
public String getValueFrom(URI uri) {
99-
return uri.getSchemeSpecificPart();
99+
return uri == null ? null : uri.getSchemeSpecificPart();
100100
}
101101
},
102102
Mido("mido", String.class), Pvlan("pvlan", String.class),
@@ -176,7 +176,7 @@ public <T> URI toUri(T value) {
176176
* @return the scheme as BroadcastDomainType
177177
*/
178178
public static BroadcastDomainType getSchemeValue(URI uri) {
179-
return toEnumValue(uri.getScheme());
179+
return toEnumValue(uri == null ? null : uri.getScheme());
180180
}
181181

182182
/**
@@ -190,7 +190,7 @@ public static BroadcastDomainType getTypeOf(String str) throws URISyntaxExceptio
190190
if (com.cloud.dc.Vlan.UNTAGGED.equalsIgnoreCase(str)) {
191191
return Native;
192192
}
193-
return getSchemeValue(new URI(str));
193+
return getSchemeValue(str == null ? null : new URI(str));
194194
}
195195

196196
/**
@@ -219,7 +219,7 @@ public static BroadcastDomainType toEnumValue(String scheme) {
219219
* @return the host part as String
220220
*/
221221
public String getValueFrom(URI uri) {
222-
return uri.getHost();
222+
return uri == null ? null : uri.getHost();
223223
}
224224

225225
/**
@@ -242,7 +242,7 @@ public static String getValue(URI uri) {
242242
* @throws URISyntaxException the string is not even an uri
243243
*/
244244
public static String getValue(String uriString) throws URISyntaxException {
245-
return getValue(new URI(uriString));
245+
return getValue(uriString == null ? null : new URI(uriString));
246246
}
247247

248248
/**

api/src/main/java/com/cloud/network/as/AutoScaleVmGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static State fromValue(String state) {
4343
} else if (state.equalsIgnoreCase("scaling")) {
4444
return SCALING;
4545
} else {
46-
throw new IllegalArgumentException("Unexpected AutoScale VM group state : " + state);
46+
throw new IllegalArgumentException("Unexpected AutoScale Instance group state : " + state);
4747
}
4848
}
4949
}

api/src/main/java/com/cloud/server/ManagementService.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
import com.cloud.capacity.Capacity;
7272
import com.cloud.dc.Pod;
7373
import com.cloud.dc.Vlan;
74+
import com.cloud.deploy.DeploymentPlan;
75+
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
7476
import com.cloud.exception.ConcurrentOperationException;
7577
import com.cloud.exception.ManagementServerException;
7678
import com.cloud.exception.ResourceUnavailableException;
@@ -91,6 +93,7 @@
9193
import com.cloud.vm.InstanceGroup;
9294
import com.cloud.vm.VirtualMachine;
9395
import com.cloud.vm.VirtualMachine.Type;
96+
import com.cloud.vm.VirtualMachineProfile;
9497

9598
/**
9699
* Hopefully this is temporary.
@@ -452,6 +455,19 @@ public interface ManagementService {
452455

453456
Ternary<Pair<List<? extends Host>, Integer>, List<? extends Host>, Map<Host, Boolean>> listHostsForMigrationOfVM(VirtualMachine vm, Long startIndex, Long pageSize, String keyword, List<VirtualMachine> vmList);
454457

458+
/**
459+
* Apply affinity group constraints and other exclusion rules for VM migration.
460+
* This is a helper method that can be used independently for per-iteration affinity checks in DRS.
461+
*
462+
* @param vm The virtual machine to migrate
463+
* @param vmProfile The VM profile
464+
* @param plan The deployment plan
465+
* @param vmList List of VMs with current/simulated placements for affinity processing
466+
* @return ExcludeList containing hosts to avoid
467+
*/
468+
ExcludeList applyAffinityConstraints(VirtualMachine vm, VirtualMachineProfile vmProfile,
469+
DeploymentPlan plan, List<VirtualMachine> vmList);
470+
455471
/**
456472
* List storage pools for live migrating of a volume. The API returns list of all pools in the cluster to which the
457473
* volume can be migrated. Current pool is not included in the list. In case of vSphere datastore cluster storage pools,

0 commit comments

Comments
 (0)