mirror of https://github.com/apache/cloudstack.git
Merge branch '4.19' into 4.20
This commit is contained in:
commit
1961aea770
|
|
@ -37,4 +37,6 @@ public interface AutoScaleVmGroupVmMapDao extends GenericDao<AutoScaleVmGroupVmM
|
|||
public boolean removeByGroup(long vmGroupId);
|
||||
|
||||
int expungeByVmList(List<Long> vmIds, Long batchSize);
|
||||
|
||||
int getErroredInstanceCount(long vmGroupId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,4 +127,13 @@ public class AutoScaleVmGroupVmMapDaoImpl extends GenericDaoBase<AutoScaleVmGrou
|
|||
sc.setParameters("vmIds", vmIds.toArray());
|
||||
return batchExpunge(sc, batchSize);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getErroredInstanceCount(long vmGroupId) {
|
||||
SearchCriteria<Integer> sc = CountBy.create();
|
||||
sc.setParameters("vmGroupId", vmGroupId);
|
||||
sc.setJoinParameters("vmSearch", "states", State.Error);
|
||||
final List<Integer> results = customSearch(sc, null);
|
||||
return results.get(0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,8 @@ import java.util.stream.Collectors;
|
|||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
|
||||
import com.cloud.network.as.AutoScaleManager;
|
||||
import com.cloud.user.AccountManagerImpl;
|
||||
import org.apache.cloudstack.acl.RoleType;
|
||||
import org.apache.cloudstack.acl.SecurityChecker;
|
||||
|
|
@ -582,6 +584,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||
configValuesForValidation.add(UserDataManager.VM_USERDATA_MAX_LENGTH_STRING);
|
||||
configValuesForValidation.add(UnmanagedVMsManager.RemoteKvmInstanceDisksCopyTimeout.key());
|
||||
configValuesForValidation.add(UnmanagedVMsManager.ConvertVmwareInstanceToKvmTimeout.key());
|
||||
configValuesForValidation.add(AutoScaleManager.AutoScaleErroredInstanceThreshold.key());
|
||||
}
|
||||
|
||||
protected void weightBasedParametersForValidation() {
|
||||
|
|
|
|||
|
|
@ -39,6 +39,12 @@ public interface AutoScaleManager extends AutoScaleService {
|
|||
"The Number of worker threads to scan the autoscale vm groups.",
|
||||
false);
|
||||
|
||||
ConfigKey<Integer> AutoScaleErroredInstanceThreshold = new ConfigKey<>(ConfigKey.CATEGORY_ADVANCED, Integer.class,
|
||||
"autoscale.errored.instance.threshold",
|
||||
"10",
|
||||
"The number of Error Instances allowed in autoscale vm groups for scale up.",
|
||||
true);
|
||||
|
||||
void checkAutoScaleUser(Long autoscaleUserId, long accountId);
|
||||
|
||||
boolean deleteAutoScaleVmGroupsByAccount(Account account);
|
||||
|
|
|
|||
|
|
@ -1718,6 +1718,11 @@ public class AutoScaleManagerImpl extends ManagerBase implements AutoScaleManage
|
|||
logger.warn("number of VM will greater than the maximum in this group if scaling up, so do nothing more");
|
||||
return false;
|
||||
}
|
||||
int erroredInstanceCount = autoScaleVmGroupVmMapDao.getErroredInstanceCount(asGroup.getId());
|
||||
if (erroredInstanceCount > AutoScaleManager.AutoScaleErroredInstanceThreshold.value()) {
|
||||
logger.warn("Number of Errored Instances are greater than the threshold in this group for scaling up, so do nothing more");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -2198,7 +2203,8 @@ public class AutoScaleManagerImpl extends ManagerBase implements AutoScaleManage
|
|||
return new ConfigKey<?>[] {
|
||||
AutoScaleStatsInterval,
|
||||
AutoScaleStatsCleanupDelay,
|
||||
AutoScaleStatsWorker
|
||||
AutoScaleStatsWorker,
|
||||
AutoScaleErroredInstanceThreshold
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
<tooltip-label :title="$t('label.systemvmtype')" :tooltip="apiParams.systemvmtype.description"/>
|
||||
</template>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.systemvmtype"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -214,6 +215,7 @@
|
|||
<tooltip-label :title="$t('label.deploymentplanner')" :tooltip="apiParams.deploymentplanner.description"/>
|
||||
</template>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.deploymentplanner"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -245,6 +247,7 @@
|
|||
</a-form-item>
|
||||
<a-form-item name="pcidevice" ref="pcidevice" :label="$t('label.gpu')" v-if="!isSystem">
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.pcidevice"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -260,6 +263,7 @@
|
|||
</a-form-item>
|
||||
<a-form-item name="vgputype" ref="vgputype" :label="$t('label.vgputype')" v-if="vGpuVisible">
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.vgputype"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -281,6 +285,7 @@
|
|||
</template>
|
||||
<a-select
|
||||
mode="multiple"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.domainid"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -305,6 +310,7 @@
|
|||
<a-select
|
||||
id="zone-selection"
|
||||
mode="multiple"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.zoneid"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -331,6 +337,7 @@
|
|||
<tooltip-label :title="$t('label.vmware.storage.policy')" :tooltip="apiParams.storagepolicy.description"/>
|
||||
</template>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.storagepolicy"
|
||||
:placeholder="apiParams.storagepolicy.description"
|
||||
showSearch
|
||||
|
|
@ -525,6 +532,7 @@
|
|||
</template>
|
||||
<a-select
|
||||
mode="tags"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.storagetags"
|
||||
showSearch
|
||||
optionFilterProp="value"
|
||||
|
|
@ -564,6 +572,7 @@
|
|||
<br /><br />
|
||||
<a-form-item :label="$t('label.disk.offerings')" name="diskofferingid" ref="diskofferingid">
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.diskofferingid"
|
||||
:loading="loading"
|
||||
:placeholder="$t('label.diskoffering')">
|
||||
|
|
|
|||
|
|
@ -218,6 +218,7 @@
|
|||
<tooltip-label :title="$t('label.storagetags')" :tooltip="apiParams.tags.description"/>
|
||||
</template>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
mode="tags"
|
||||
v-model:value="form.tags"
|
||||
showSearch
|
||||
|
|
@ -242,6 +243,7 @@
|
|||
</template>
|
||||
<a-select
|
||||
mode="multiple"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.domainid"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -266,6 +268,7 @@
|
|||
<a-select
|
||||
id="zone-selection"
|
||||
mode="multiple"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.zoneid"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -289,6 +292,7 @@
|
|||
<tooltip-label :title="$t('label.vmware.storage.policy')" :tooltip="apiParams.storagepolicy.description"/>
|
||||
</template>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.storagepolicy"
|
||||
:placeholder="apiParams.storagepolicy.description"
|
||||
showSearch
|
||||
|
|
|
|||
|
|
@ -323,6 +323,7 @@
|
|||
<tooltip-label :title="$t('label.serviceofferingid')" :tooltip="apiParams.serviceofferingid.description"/>
|
||||
</template>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
v-model:value="form.serviceofferingid"
|
||||
|
|
@ -505,6 +506,7 @@
|
|||
</template>
|
||||
<a-select
|
||||
mode="multiple"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.domainid"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -529,6 +531,7 @@
|
|||
<a-select
|
||||
id="zone-selection"
|
||||
mode="multiple"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.zoneid"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@
|
|||
<tooltip-label :title="$t('label.serviceofferingid')" :tooltip="apiParams.serviceofferingid.description"/>
|
||||
</template>
|
||||
<a-select
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
v-model:value="form.serviceofferingid"
|
||||
|
|
@ -189,6 +190,7 @@
|
|||
</template>
|
||||
<a-select
|
||||
mode="multiple"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.domainid"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
@ -213,6 +215,7 @@
|
|||
<a-select
|
||||
id="zone-selection"
|
||||
mode="multiple"
|
||||
:getPopupContainer="(trigger) => trigger.parentNode"
|
||||
v-model:value="form.zoneid"
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
|
|
|
|||
Loading…
Reference in New Issue