Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
8cbddf253a9462b81e9ee522116583b3bd7ef6532974539e29121b1e396516830b8c0482b98d23e145dddb6b7621f23c7efa4d064cd136db4fa20f471d1ee14a08b1e0a67da80860d1e15ccfbfe66c085200e01cca15896586f261e8ab7827f5e3292e69c17e53af8d347428d63454ce6cd045446250e55f36ddba5fa9887fc885759e11ea01edb10785ac2c01142cd9843efc4a1cc8906f6299735b257acb20e5f5e866cc887ac4380c9b0324e8926a48ac8825e4b6afd17e2ce50689a33641139ef51b2bdd3d08b0554c289b6dea9f536b88b8c4db67861494e9c55ef273cbd49bab70422e0e4d11ea726c05cb062fa0cfc7d93e33eec1ebe80bafc622904fd14a879787f1405aa40c6ba24bf8677d468718b9c5b849e8a6b2371ffb3d9f390c14b6038c6082620a7027d8f97d61f8896d1482e49ad71820192f274330d51b38de324bc73433db666b391d133b4293316a43a0378e1df1b9baf6872512f82b33c226879f26c2fa7b982501fde0185c249c9248b85526d37af8786eec38fea654781202439868c1f3ac89b37139d0c5be93a62831c978f6423b187e51bc6ef8d500ccbc940916a6f2b0b38796ce606381a3c91c396c3210fef69e9541bff8eabcef5686efee511a93a6db663500d111510510e868b5e03ebac54a79191bc5d97d20aa9ee0b7b5a9274071962165343136788247e3249c8b3c3b3365fa86f5e1532add505d5f41c276510f5e6128a03b29ba1d6a75abaf9457c1f36fff01e6deb6f0e8b93ddc49ba7dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
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", | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| "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) { | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| 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 |
|---|---|---|
| @@ -52,5 +52,175 @@ | ||
| <groupId>mysql</groupId> | ||
| <artifactId>mysql-connector-java</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.ini4j</groupId> | ||
| <artifactId>ini4j</artifactId> | ||
| <version>${cs.ini.version}</version> | ||
| </dependency> | ||
| </dependencies> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.codehaus.gmaven</groupId> | ||
| <artifactId>gmaven-plugin</artifactId> | ||
| <version>1.5</version> | ||
| <executions> | ||
| <execution> | ||
| <id>setproperty</id> | ||
| <phase>validate</phase> | ||
| <goals> | ||
| <goal>execute</goal> | ||
| </goals> | ||
| <configuration> | ||
| <source> | ||
| def projectVersion = project.version | ||
| String[] versionParts = projectVersion.tokenize('.') | ||
| pom.properties['cs.version'] = versionParts[0] + "." + versionParts[1] | ||
| pom.properties['patch.version'] = versionParts[2] | ||
| </source> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>com.googlecode.maven-download-plugin</groupId> | ||
| <artifactId>download-maven-plugin</artifactId> | ||
| <version>1.6.3</version> | ||
| <executions> | ||
| <execution> | ||
| <id>download-checksums</id> | ||
| <phase>validate</phase> | ||
| <goals> | ||
| <goal>wget</goal> | ||
| </goals> | ||
| <configuration> | ||
| <url>https://download.cloudstack.org/systemvm/${cs.version}/md5sum.txt</url> | ||
| <outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory> | ||
| <skipCache>true</skipCache> | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| <overwrite>true</overwrite> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.codehaus.gmaven</groupId> | ||
| <artifactId>gmaven-plugin</artifactId> | ||
| <version>1.5</version> | ||
| <executions> | ||
| <execution> | ||
| <id>set-properties</id> | ||
| <phase>generate-sources</phase> | ||
| <goals> | ||
| <goal>execute</goal> | ||
| </goals> | ||
| <configuration> | ||
| <source> | ||
| def csVersion = pom.properties['cs.version'] | ||
| def patch = pom.properties['patch.version'] | ||
| def templateList = [] | ||
| templateList.add("systemvmtemplate-${csVersion}.${patch}-kvm") | ||
| templateList.add("systemvmtemplate-${csVersion}.${patch}-vmware") | ||
| templateList.add("systemvmtemplate-${csVersion}.${patch}-xen") | ||
| templateList.add("systemvmtemplate-${csVersion}.${patch}-ovm") | ||
| templateList.add("systemvmtemplate-${csVersion}.${patch}-hyperv") | ||
| File file = new File("./engine/schema/dist/systemvm-templates/md5sum.txt") | ||
| def lines = file.readLines() | ||
| for (template in templateList) { | ||
| def data = lines.findAll { it.contains(template) } | ||
| if (data != null) { | ||
| def hypervisor = template.tokenize('-')[-1] | ||
| pom.properties["$hypervisor" + ".checksum"] = data[0].tokenize(' ')[0] | ||
| } | ||
| } | ||
| </source> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.codehaus.mojo</groupId> | ||
| <artifactId>exec-maven-plugin</artifactId> | ||
| <version>1.2.1</version> | ||
| <executions> | ||
| <execution> | ||
| <id>systemvm-template-metadata</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>exec</goal> | ||
| </goals> | ||
| <configuration> | ||
| <workingDirectory>${basedir}/</workingDirectory> | ||
| <executable>bash</executable> | ||
| <arguments> | ||
| <argument>templateConfig.sh</argument> | ||
| <armument>${project.version}</armument> | ||
| </arguments> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| <profiles> | ||
| <profile> | ||
| <id>template-create</id> | ||
| <activation> | ||
| <property> | ||
| <name>noredist</name> | ||
| </property> | ||
| </activation> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-resources-plugin</artifactId> | ||
| <version>${cs.resources-plugin.version}</version> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>com.googlecode.maven-download-plugin</groupId> | ||
| <artifactId>download-maven-plugin</artifactId> | ||
| <version>1.6.3</version> | ||
| <executions> | ||
| <execution> | ||
| <id>download-kvm-template</id> | ||
| <goals> | ||
| <goal>wget</goal> | ||
| </goals> | ||
| <configuration> | ||
| <checkSignature>true</checkSignature> | ||
| <url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-kvm.qcow2.bz2</url> | ||
| <outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory> | ||
yadvr marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| <md5>${kvm.checksum}</md5> | ||
| </configuration> | ||
| </execution> | ||
| <execution> | ||
| <id>download-vmware-template</id> | ||
| <goals> | ||
| <goal>wget</goal> | ||
| </goals> | ||
| <configuration> | ||
| <checkSignature>true</checkSignature> | ||
| <url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-vmware.ova</url> | ||
| <outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory> | ||
| <md5>${vmware.checksum}</md5> | ||
| </configuration> | ||
Pearl1594 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| </execution> | ||
| <execution> | ||
| <id>download-xenserver-template</id> | ||
| <goals> | ||
| <goal>wget</goal> | ||
| </goals> | ||
| <configuration> | ||
| <checkSignature>true</checkSignature> | ||
| <url>https://download.cloudstack.org/systemvm/${cs.version}/systemvmtemplate-${cs.version}.${patch.version}-xen.vhd.bz2</url> | ||
| <outputDirectory>${basedir}/dist/systemvm-templates/</outputDirectory> | ||
Pearl1594 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| <md5>${xen.checksum}</md5> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </profile> | ||
| </profiles> | ||
| </project> | ||
| 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.
Uh oh!
There was an error while loading. Please reload this page.