-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Adding AutoScaling for cks + CKS CoreOS EOL update + systemvmtemplate improvements #4329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8cbddf2
53a9462
b81e9ee
5221165
83b3bd7
ef65329
74539e2
9121b1e
3965168
30b8c04
82b98d2
3e145dd
db6b762
1f23c7e
fa4d064
cd136db
4fa20f4
71d1ee1
4a08b1e
0a67da8
0860d1e
15ccfbf
e66c085
200e01c
ca15896
586f261
e8ab782
7f5e329
2e69c17
e53af8d
347428d
63454ce
6cd0454
46250e5
5f36ddb
a5fa988
7fc8857
59e11ea
01edb10
785ac2c
01142cd
9843efc
4a1cc89
06f6299
735b257
acb20e5
f5e866c
c887ac4
380c9b0
324e892
6a48ac8
825e4b6
afd17e2
ce50689
a336411
39ef51b
2bdd3d0
8b0554c
289b6de
a9f536b
88b8c4d
b678614
94e9c55
ef273cb
d49bab7
0422e0e
4d11ea7
26c05cb
062fa0c
fc7d93e
33eec1e
be80baf
c622904
fd14a87
9787f14
05aa40c
6ba24bf
8677d46
8718b9c
5b849e8
a6b2371
ffb3d9f
390c14b
6038c60
82620a7
027d8f9
7d61f88
96d1482
e49ad71
820192f
274330d
51b38de
324bc73
433db66
6b391d1
33b4293
316a43a
0378e1d
f1b9baf
6872512
f82b33c
226879f
26c2fa7
b982501
fde0185
c249c92
48b8552
6d37af8
786eec3
8fea654
7812024
39868c1
f3ac89b
37139d0
c5be93a
62831c9
78f6423
b187e51
bc6ef8d
500ccbc
940916a
6f2b0b3
8796ce6
06381a3
c91c396
c3210fe
f69e954
1bff8ea
bcef568
6efee51
1a93a6d
b663500
d111510
510e868
b5e03eb
ac54a79
191bc5d
97d20aa
9ee0b7b
5a92740
7196216
5343136
788247e
3249c8b
3c3b336
5fa86f5
e1532ad
d505d5f
41c2765
10f5e61
28a03b2
9ba1d6a
75abaf9
457c1f3
6fff01e
6deb6f0
e8b93dd
c49ba7d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -412,6 +412,10 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac | |
| static final ConfigKey<Boolean> HaVmRestartHostUp = new ConfigKey<Boolean>("Advanced", Boolean.class, "ha.vm.restart.hostup", "true", | ||
| "If an out-of-band stop of a VM is detected and its host is up, then power on the VM", true); | ||
|
|
||
| static final ConfigKey<Long> SystemVmRootDiskSize = new ConfigKey<Long>("Advanced", | ||
| Long.class, "systemvm.root.disk.size", "-1", | ||
rohityadavcloud marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "Size of root volume (in GB) of system VMs and virtual routers", true); | ||
|
|
||
| ScheduledExecutorService _executor = null; | ||
|
|
||
| private long _nodeId; | ||
|
|
@@ -460,6 +464,12 @@ public void allocate(final String vmInstanceName, final VirtualMachineTemplate t | |
|
|
||
| final VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmFinal, template, serviceOffering, null, null); | ||
|
|
||
| Long rootDiskSize = rootDiskOfferingInfo.getSize(); | ||
| if (vm.getType().isUsedBySystem() && SystemVmRootDiskSize.value() != null && SystemVmRootDiskSize.value() > 0L) { | ||
rohityadavcloud marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| rootDiskSize = SystemVmRootDiskSize.value(); | ||
| } | ||
| final Long rootDiskSizeFinal = rootDiskSize; | ||
|
Comment on lines
+467
to
+471
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice little utility method |
||
|
|
||
| Transaction.execute(new TransactionCallbackWithExceptionNoReturn<InsufficientCapacityException>() { | ||
| @Override | ||
| public void doInTransactionWithoutResult(final TransactionStatus status) throws InsufficientCapacityException { | ||
|
|
@@ -485,7 +495,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) throws | |
| } else if (template.getFormat() == ImageFormat.BAREMETAL) { | ||
| // Do nothing | ||
| } else { | ||
| volumeMgr.allocateTemplatedVolumes(Type.ROOT, "ROOT-" + vmFinal.getId(), rootDiskOfferingInfo.getDiskOffering(), rootDiskOfferingInfo.getSize(), | ||
| volumeMgr.allocateTemplatedVolumes(Type.ROOT, "ROOT-" + vmFinal.getId(), rootDiskOfferingInfo.getDiskOffering(), rootDiskSizeFinal, | ||
| rootDiskOfferingInfo.getMinIops(), rootDiskOfferingInfo.getMaxIops(), template, vmFinal, owner); | ||
| } | ||
|
|
||
|
|
@@ -1728,7 +1738,7 @@ protected boolean sendStop(final VirtualMachineGuru guru, final VirtualMachinePr | |
|
|
||
| final UserVmVO userVm = _userVmDao.findById(vm.getId()); | ||
| if (vm.getType() == VirtualMachine.Type.User) { | ||
| if (userVm != null){ | ||
| if (userVm != null) { | ||
| userVm.setPowerState(PowerState.PowerOff); | ||
| _userVmDao.update(userVm.getId(), userVm); | ||
| } | ||
|
|
@@ -4829,7 +4839,7 @@ public ConfigKey<?>[] getConfigKeys() { | |
| return new ConfigKey<?>[] { ClusterDeltaSyncInterval, StartRetry, VmDestroyForcestop, VmOpCancelInterval, VmOpCleanupInterval, VmOpCleanupWait, | ||
| VmOpLockStateRetry, VmOpWaitInterval, ExecuteInSequence, VmJobCheckInterval, VmJobTimeout, VmJobStateReportInterval, | ||
| VmConfigDriveLabel, VmConfigDriveOnPrimaryPool, VmConfigDriveForceHostCacheUse, VmConfigDriveUseHostCacheOnUnsupportedPool, | ||
| HaVmRestartHostUp, ResourceCountRunningVMsonly, AllowExposeHypervisorHostname, AllowExposeHypervisorHostnameAccountLevel }; | ||
| HaVmRestartHostUp, ResourceCountRunningVMsonly, AllowExposeHypervisorHostname, AllowExposeHypervisorHostnameAccountLevel, SystemVmRootDiskSize }; | ||
| } | ||
|
|
||
| public List<StoragePoolAllocator> getStoragePoolAllocators() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |||||
|
|
||||||
| import java.util.List; | ||||||
| import java.util.Map; | ||||||
| import java.util.Set; | ||||||
|
|
||||||
| public interface ClusterDao extends GenericDao<ClusterVO, Long> { | ||||||
| List<ClusterVO> listByPodId(long podId); | ||||||
|
|
@@ -34,6 +35,8 @@ public interface ClusterDao extends GenericDao<ClusterVO, Long> { | |||||
|
|
||||||
| List<HypervisorType> getAvailableHypervisorInZone(Long zoneId); | ||||||
|
|
||||||
| Set<HypervisorType> getDistictAvailableHypervisorsAcrossClusters(); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
typo ^^^ |
||||||
|
|
||||||
| List<ClusterVO> listByDcHyType(long dcId, String hyType); | ||||||
|
|
||||||
| Map<Long, List<Long>> getPodClusterIdMap(List<Long> clusterIds); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -39,8 +39,10 @@ | |||||
| import java.sql.SQLException; | ||||||
| import java.util.ArrayList; | ||||||
| import java.util.HashMap; | ||||||
| import java.util.HashSet; | ||||||
| import java.util.List; | ||||||
| import java.util.Map; | ||||||
| import java.util.Set; | ||||||
|
|
||||||
| @Component | ||||||
| public class ClusterDaoImpl extends GenericDaoBase<ClusterVO, Long> implements ClusterDao { | ||||||
|
|
@@ -51,6 +53,7 @@ public class ClusterDaoImpl extends GenericDaoBase<ClusterVO, Long> implements C | |||||
| protected final SearchBuilder<ClusterVO> ZoneSearch; | ||||||
| protected final SearchBuilder<ClusterVO> ZoneHyTypeSearch; | ||||||
| protected final SearchBuilder<ClusterVO> ZoneClusterSearch; | ||||||
| protected final SearchBuilder<ClusterVO> ClusterSearch; | ||||||
|
|
||||||
| protected GenericSearchBuilder<ClusterVO, Long> ClusterIdSearch; | ||||||
|
|
||||||
|
|
@@ -97,6 +100,10 @@ public ClusterDaoImpl() { | |||||
| ClusterIdSearch.selectFields(ClusterIdSearch.entity().getId()); | ||||||
| ClusterIdSearch.and("dataCenterId", ClusterIdSearch.entity().getDataCenterId(), Op.EQ); | ||||||
| ClusterIdSearch.done(); | ||||||
|
|
||||||
| ClusterSearch = createSearchBuilder(); | ||||||
| ClusterSearch.select(null, Func.DISTINCT, ClusterSearch.entity().getHypervisorType()); | ||||||
| ClusterIdSearch.done(); | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
|
|
@@ -154,6 +161,17 @@ public List<HypervisorType> getAvailableHypervisorInZone(Long zoneId) { | |||||
| return hypers; | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
| public Set<HypervisorType> getDistictAvailableHypervisorsAcrossClusters() { | ||||||
| SearchCriteria<ClusterVO> sc = ClusterSearch.create(); | ||||||
| List<ClusterVO> clusters = listBy(sc); | ||||||
| Set<HypervisorType> hypers = new HashSet<>(); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| for (ClusterVO cluster : clusters) { | ||||||
| hypers.add(cluster.getHypervisorType()); | ||||||
| } | ||||||
| return hypers; | ||||||
| } | ||||||
|
|
||||||
| @Override | ||||||
| public Map<Long, List<Long>> getPodClusterIdMap(List<Long> clusterIds) { | ||||||
| TransactionLegacy txn = TransactionLegacy.currentTxn(); | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.