Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
8cbddf2
Adding nodeid param in scalekubecluster
davidjumani Sep 17, 2020
53a9462
Changing cks nomenclature
davidjumani Sep 21, 2020
b81e9ee
Adding isMaster in KubernetesClusterVmMap
davidjumani Oct 1, 2020
5221165
Ensuring we dont remove all masters
davidjumani Oct 1, 2020
83b3bd7
Deploying the autoscaler
davidjumani Oct 20, 2020
ef65329
Adding public ip to listKubernetesClusterResponse
davidjumani Oct 20, 2020
74539e2
Adding api keys during cluster creation
davidjumani Oct 21, 2020
9121b1e
Cleanup
davidjumani Oct 22, 2020
3965168
Deploy keys as a secret file
davidjumani Oct 23, 2020
30b8c04
Cleanup
davidjumani Oct 23, 2020
82b98d2
Adding smoke tests
davidjumani Oct 25, 2020
3e145dd
Allowing for upgrades
davidjumani Oct 27, 2020
db6b762
Ensure there's always a node during scale down
davidjumani Oct 28, 2020
1f23c7e
Tweaking nw rules while scaling
davidjumani Oct 28, 2020
fa4d064
Cleanup
davidjumani Oct 28, 2020
cd136db
Enhancing auytoscaler deployment
davidjumani Oct 29, 2020
4fa20f4
Fixing tests
davidjumani Oct 29, 2020
71d1ee1
Refactoring
davidjumani Oct 29, 2020
4a08b1e
Adding logs for upgrade failure
davidjumani Oct 29, 2020
0a67da8
More cleanup
davidjumani Oct 29, 2020
0860d1e
Limiting max cluster size to global setting KubernetesMaxClusterSize
davidjumani Nov 1, 2020
15ccfbf
CKS CoreOS EOL update (#68)
Pearl1594 Nov 2, 2020
e66c085
Adding verbosity to upgrade script
davidjumani Nov 2, 2020
200e01c
Adding supportsautoscaling to supported version response
davidjumani Nov 2, 2020
ca15896
Refactor
davidjumani Nov 2, 2020
586f261
Adding licensing headers
davidjumani Nov 2, 2020
e8ab782
Adding absolute path to kubectl
davidjumani Nov 2, 2020
7f5e329
Removing sudo for kubectl commands
davidjumani Nov 2, 2020
2e69c17
refactor code and test
Nov 3, 2020
e53af8d
Refactoring tests
davidjumani Nov 3, 2020
347428d
Fixes
davidjumani Nov 3, 2020
63454ce
Upgrade path changes
davidjumani Nov 4, 2020
6cd0454
Added core user for b/w compatibility + cks template fixes
Nov 6, 2020
46250e5
Renaming db column
davidjumani Nov 6, 2020
5f36ddb
systemvm: install haproxy 1.8 instead of 1.7 to support HTTP2
ustcweizhou Feb 14, 2020
a5fa988
systemvm: configurable root disk size
ustcweizhou Feb 14, 2020
7fc8857
systemvm: auto-grow partitions only when growpart is found
ustcweizhou Feb 27, 2020
59e11ea
add haproxy back
ustcweizhou Jul 10, 2020
01edb10
grow root partition for cks node
Nov 9, 2020
785ac2c
Updating api param doc
davidjumani Nov 10, 2020
01142cd
Refactoring tests
davidjumani Nov 10, 2020
9843efc
fix port number passed on shared n/ws + optimize disk size
Nov 11, 2020
4a1cc89
Adding kubernetes as a dependency for marvin
davidjumani Nov 20, 2020
06f6299
Port UI changes
Feb 4, 2021
735b257
Fix versions
Feb 5, 2021
acb20e5
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Feb 16, 2021
f5e866c
CKS deployment fix for Vmware - resize volume
Mar 17, 2021
c887ac4
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Mar 17, 2021
380c9b0
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Mar 17, 2021
324e892
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Mar 23, 2021
6a48ac8
Update deploy as is field for templates registed < ACS 4.15
Mar 23, 2021
825e4b6
Merge branch 'add-cks-autoscaling' of github.com:shapeblue/cloudstack…
Mar 23, 2021
afd17e2
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Mar 24, 2021
ce50689
Allow vol snap for a disk brought up using sysvm template - only for …
Mar 25, 2021
a336411
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Mar 25, 2021
39ef51b
Update sysvm template + default to legacy iptables on cks nodes
Mar 26, 2021
2bdd3d0
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Mar 31, 2021
8b0554c
enable full clone for vmware for cks tests
Mar 31, 2021
289b6de
Update checksums for new system vm template
Mar 31, 2021
a9f536b
Merge branch 'add-cks-autoscaling' of github.com:shapeblue/cloudstack…
Apr 1, 2021
88b8c4d
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Pearl1594 May 26, 2021
b678614
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Pearl1594 May 26, 2021
94e9c55
Merge branch 'add-cks-autoscaling' of github.com:shapeblue/cloudstack…
Pearl1594 May 27, 2021
ef273cb
Merge branch 'master' of https://github.com/apache/cloudstack into ad…
Pearl1594 Jun 9, 2021
d49bab7
fix test and dependencies
Pearl1594 Jun 10, 2021
0422e0e
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Jul 8, 2021
4d11ea7
test changes to include inclusivity changes
Pearl1594 Jul 8, 2021
26c05cb
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Jul 19, 2021
062fa0c
SystemVM upgrade improvements
Pearl1594 Jul 20, 2021
fc7d93e
install pkg - requests
Pearl1594 Jul 20, 2021
33eec1e
Add logic for template registration if not preset
Pearl1594 Jul 21, 2021
be80baf
handle automatic upgrade if templates present in package(cloudstack-m…
Pearl1594 Jul 26, 2021
c622904
packaging fixes
Pearl1594 Jul 28, 2021
fd14a87
1. Move download of templates and creation of meta file logic to mvn …
Pearl1594 Jul 29, 2021
9787f14
fix rpm build
Pearl1594 Jul 30, 2021
05aa40c
fix deb rules
Pearl1594 Jul 30, 2021
6ba24bf
fix deb rules
Pearl1594 Jul 30, 2021
8677d46
fix deb rules
Pearl1594 Jul 30, 2021
8718b9c
test
Pearl1594 Jul 30, 2021
5b849e8
Merge branch 'test-packaging' of github.com:shapeblue/cloudstack into…
Pearl1594 Jul 30, 2021
a6b2371
cleanup
Pearl1594 Jul 30, 2021
ffb3d9f
Merge branch 'main' of https://github.com/apache/cloudstack into sysv…
Pearl1594 Jul 30, 2021
390c14b
update injectkeys.sh script to only copy private key to hosts and upd…
Pearl1594 Aug 2, 2021
6038c60
Fix travis failure
Pearl1594 Aug 2, 2021
82620a7
Update registration workflow during upgrade
Pearl1594 Aug 2, 2021
027d8f9
change master reference in k8s context to control Node
Pearl1594 Aug 2, 2021
7d61f88
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 2, 2021
96d1482
upgrade setuptools - required by k8s
Pearl1594 Aug 2, 2021
e49ad71
Change location of template files and script to work with simulator b…
Pearl1594 Aug 3, 2021
820192f
Port python script to bash - to avoid package installations
Pearl1594 Aug 4, 2021
274330d
Merge branch 'main' of https://github.com/apache/cloudstack into sysv…
Pearl1594 Aug 5, 2021
51b38de
Merge branch 'sysvm-upgrade-improvements' of github.com:shapeblue/clo…
Pearl1594 Aug 5, 2021
324bc73
add logic to get code version
Pearl1594 Aug 5, 2021
433db66
update naming convention + identify store to be used on a per zone basis
Pearl1594 Aug 6, 2021
6b391d1
Merge branch 'sysvm-upgrade-improvements' of github.com:shapeblue/clo…
Pearl1594 Aug 6, 2021
33b4293
add timeout constant
Pearl1594 Aug 6, 2021
316a43a
modify script permission
Pearl1594 Aug 6, 2021
0378e1d
cleanup + prevent hardcoded ssh location - as ubuntu places it at /va…
Pearl1594 Aug 6, 2021
f1b9baf
fix failing test - delete k8s cluster
Pearl1594 Aug 6, 2021
6872512
fix test
Pearl1594 Aug 9, 2021
f82b33c
Merge branch 'main' of github.com:apache/cloudstack into add-cks-auto…
davidjumani Aug 9, 2021
226879f
Fix checkstyle
davidjumani Aug 9, 2021
26c2fa7
register sysvm template on addition of 1st store in a zone
Pearl1594 Aug 9, 2021
b982501
validate if template is registered/seeded in a fresh env and bypass r…
Pearl1594 Aug 9, 2021
fde0185
remove unnecessary commit
Pearl1594 Aug 10, 2021
c249c92
Fix setup-kube-system
davidjumani Aug 10, 2021
48b8552
Add kubectl path in deployprovider
davidjumani Aug 10, 2021
6d37af8
upgraded sysvm template + temporary changes wrt sysvm url path
Pearl1594 Aug 10, 2021
786eec3
Merge branch 'add-cks-autoscaling' of github.com:shapeblue/cloudstack…
Pearl1594 Aug 10, 2021
8fea654
Remove redundant validtion
davidjumani Aug 11, 2021
7812024
add dependency req for k8s versions > 1.18 + move conf / service file…
Pearl1594 Aug 11, 2021
39868c1
Merge branch 'add-cks-autoscaling' of github.com:shapeblue/cloudstack…
Pearl1594 Aug 11, 2021
f3ac89b
update branch
Pearl1594 Aug 11, 2021
37139d0
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 13, 2021
c5be93a
ssh key missing - iLB and elasticLB
Pearl1594 Aug 13, 2021
62831c9
systemvmtemplate: bump to Debian 11.0.0 systemvmtemplate
rohityadavcloud Aug 16, 2021
78f6423
fixes
rohityadavcloud Aug 16, 2021
b187e51
fix missing py3 packages (netaddr) and migrate one file to py3/flask
rohityadavcloud Aug 16, 2021
bc6ef8d
fix strongswan starter systemd
rohityadavcloud Aug 16, 2021
500ccbc
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 17, 2021
940916a
Merge branch 'debian11-systemvmtemplate' of github.com:shapeblue/clou…
Pearl1594 Aug 17, 2021
6f2b0b3
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 17, 2021
8796ce6
Merge branch 'debian11-systemvmtemplate' of github.com:shapeblue/clou…
Pearl1594 Aug 17, 2021
06381a3
address comments - part1
Pearl1594 Aug 17, 2021
c91c396
test updates + install latest packages
Pearl1594 Aug 17, 2021
c3210fe
intensify checks and queries + update authorised_keys decode logic
Pearl1594 Aug 18, 2021
f69e954
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 18, 2021
1bff8ea
fix issues with merge conflict
rohityadavcloud Aug 18, 2021
bcef568
code refactor
Pearl1594 Aug 18, 2021
6efee51
use the correct urls for downloading / referencing systemvm templates
Pearl1594 Aug 18, 2021
1a93a6d
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 19, 2021
b663500
update suse packaging to include sysvm templates
Pearl1594 Aug 19, 2021
d111510
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 20, 2021
510e868
Merge branch 'add-cks-autoscaling' of github.com:shapeblue/cloudstack…
Pearl1594 Aug 20, 2021
b5e03eb
Fix query + cleanup
Pearl1594 Aug 23, 2021
ac54a79
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 23, 2021
191bc5d
clear maven cache if template checksum file is different
Pearl1594 Aug 23, 2021
97d20aa
address review comments + cleanup
Pearl1594 Aug 23, 2021
9ee0b7b
If a template (sysvm for a hypervisor) is present in one zone, preven…
Pearl1594 Aug 24, 2021
5a92740
Addressed comments:
Pearl1594 Aug 25, 2021
7196216
Address Review comments - part2:
Pearl1594 Aug 26, 2021
5343136
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 26, 2021
788247e
fix filepath
Pearl1594 Aug 26, 2021
3249c8b
register template with same name in the 2 stores
Pearl1594 Aug 26, 2021
3c3b336
Not to use uuid as unique name to avoid unnecessary re-syncs + list t…
Pearl1594 Aug 26, 2021
5fa86f5
reduce no of db updates + revert vmwareResource change
Pearl1594 Aug 27, 2021
e1532ad
Address comments:
Pearl1594 Aug 31, 2021
d505d5f
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Aug 31, 2021
41c2765
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Sep 2, 2021
10f5e61
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Sep 8, 2021
28a03b2
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Sep 16, 2021
9ba1d6a
Fixing missing label
davidjumani Sep 21, 2021
75abaf9
Fix confusing error message
davidjumani Sep 21, 2021
457c1f3
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Sep 22, 2021
6fff01e
Merge branch 'main' of https://github.com/apache/cloudstack into add-…
Pearl1594 Sep 27, 2021
6deb6f0
Add taint on control nodes
davidjumani Sep 28, 2021
e8b93dd
Fix vm name
davidjumani Sep 28, 2021
c49ba7d
Fix name again
davidjumani Sep 29, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/main/java/com/cloud/vm/UserVmService.java
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serviceOffe
String hostName, String displayName, Long diskOfferingId, Long diskSize, String group, HypervisorType hypervisor, HTTPMethod httpmethod, String userData,
String sshKeyPair, Map<Long, IpAddresses> requestedIps, IpAddresses defaultIps, Boolean displayVm, String keyboard, List<Long> affinityGroupIdList,
Map<String, String> customParameters, String customId, Map<String, Map<Integer, String>> dhcpOptionMap, Map<Long, DiskOffering> dataDiskTemplateToDiskOfferingMap,
Map<String, String> templateOvfPropertiesMap, boolean dynamicScalingEnabled)
Map<String, String> templateOvfPropertiesMap, boolean dynamicScalingEnabled, String type)

throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;

Expand Down
5 changes: 5 additions & 0 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,16 @@ public class ApiConstants {
public static final String KUBERNETES_VERSION_ID = "kubernetesversionid";
public static final String KUBERNETES_VERSION_NAME = "kubernetesversionname";
public static final String MASTER_NODES = "masternodes";
public static final String NODE_IDS = "nodeids";
public static final String CONTROL_NODES = "controlnodes";
public static final String MIN_SEMANTIC_VERSION = "minimumsemanticversion";
public static final String MIN_KUBERNETES_VERSION_ID = "minimumkubernetesversionid";
public static final String NODE_ROOT_DISK_SIZE = "noderootdisksize";
public static final String SUPPORTS_HA = "supportsha";
public static final String SUPPORTS_AUTOSCALING = "supportsautoscaling";
public static final String AUTOSCALING_ENABLED = "autoscalingenabled";
public static final String MIN_SIZE = "minsize";
public static final String MAX_SIZE = "maxsize";

public static final String BOOT_TYPE = "boottype";
public static final String BOOT_MODE = "bootmode";
Expand Down
4 changes: 4 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,21 @@ override_dh_auto_install:
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management/lib
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management/setup
mkdir -p $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm
mkdir $(DESTDIR)/var/log/$(PACKAGE)/management
mkdir $(DESTDIR)/var/cache/$(PACKAGE)/management
mkdir $(DESTDIR)/var/log/$(PACKAGE)/ipallocator
mkdir $(DESTDIR)/var/lib/$(PACKAGE)/management
mkdir $(DESTDIR)/var/lib/$(PACKAGE)/mnt

cp -r client/target/utilities/scripts/db/* $(DESTDIR)/usr/share/$(PACKAGE)-management/setup/
cp -r client/target/classes/META-INF/webapp $(DESTDIR)/usr/share/$(PACKAGE)-management/webapp
cp server/target/conf/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/
cp client/target/conf/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/management/
cp client/target/cloud-client-ui-$(VERSION).jar $(DESTDIR)/usr/share/$(PACKAGE)-management/lib/cloudstack-$(VERSION).jar
cp client/target/lib/*jar $(DESTDIR)/usr/share/$(PACKAGE)-management/lib/
cp -r engine/schema/dist/systemvm-templates/* $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/
rm -rf $(DESTDIR)/usr/share/$(PACKAGE)-management/templates/systemvm/md5sum.txt

# nast hack for a couple of configuration files
mv $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/server/cloudstack-limits.conf $(DESTDIR)/$(SYSCONFDIR)/security/limits.d/
Expand Down
12 changes: 12 additions & 0 deletions engine/api/src/main/java/com/cloud/vm/VirtualMachineGuru.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
import com.cloud.agent.manager.Commands;
import com.cloud.deploy.DeployDestination;
import com.cloud.exception.ResourceUnavailableException;

import java.nio.charset.StandardCharsets;
import java.util.Base64;

/**
* A VirtualMachineGuru knows how to process a certain type of virtual machine.
*
Expand Down Expand Up @@ -60,4 +64,12 @@ public interface VirtualMachineGuru {
void prepareStop(VirtualMachineProfile profile);

void finalizeUnmanage(VirtualMachine vm);

static String getEncodedMsPublicKey(String pubKey) {
String base64EncodedPublicKey = null;
if (pubKey != null) {
base64EncodedPublicKey = Base64.getEncoder().encodeToString(pubKey.getBytes(StandardCharsets.UTF_8));
}
return base64EncodedPublicKey;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"Size of root volume (in GB) of system VMs and virtual routers", true);

ScheduledExecutorService _executor = null;

private long _nodeId;
Expand Down Expand Up @@ -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) {
rootDiskSize = SystemVmRootDiskSize.value();
}
final Long rootDiskSizeFinal = rootDiskSize;
Comment on lines +467 to +471
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice little utility method getIntendedRootDiskSize(DiskOffering rootDiskOfferingInfo, VirtualMachine vm) is in order here.


Transaction.execute(new TransactionCallbackWithExceptionNoReturn<InsufficientCapacityException>() {
@Override
public void doInTransactionWithoutResult(final TransactionStatus status) throws InsufficientCapacityException {
Expand All @@ -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);
}

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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() {
Expand Down
170 changes: 170 additions & 0 deletions engine/schema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
<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>
<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>
</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>
<md5>${xen.checksum}</md5>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
3 changes: 3 additions & 0 deletions engine/schema/src/main/java/com/cloud/dc/dao/ClusterDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -34,6 +35,8 @@ public interface ClusterDao extends GenericDao<ClusterVO, Long> {

List<HypervisorType> getAvailableHypervisorInZone(Long zoneId);

Set<HypervisorType> getDistictAvailableHypervisorsAcrossClusters();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set<HypervisorType> getDistictAvailableHypervisorsAcrossClusters();
Set<HypervisorType> getDistinctAvailableHypervisorsAcrossClusters();

typo ^^^


List<ClusterVO> listByDcHyType(long dcId, String hyType);

Map<Long, List<Long>> getPodClusterIdMap(List<Long> clusterIds);
Expand Down
18 changes: 18 additions & 0 deletions engine/schema/src/main/java/com/cloud/dc/dao/ClusterDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Set<HypervisorType> hypers = new HashSet<>();
Set<HypervisorType> hypervisorTypes = new HashSet<>();

for (ClusterVO cluster : clusters) {
hypers.add(cluster.getHypervisorType());
}
return hypers;
}

@Override
public Map<Long, List<Long>> getPodClusterIdMap(List<Long> clusterIds) {
TransactionLegacy txn = TransactionLegacy.currentTxn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.Map;

import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Storage;
import com.cloud.storage.VMTemplateVO;
import com.cloud.template.VirtualMachineTemplate;
import com.cloud.utils.db.GenericDao;
Expand Down Expand Up @@ -72,6 +73,8 @@ public interface VMTemplateDao extends GenericDao<VMTemplateVO, Long>, StateDao<

VMTemplateVO findRoutingTemplate(HypervisorType type, String templateName);

VMTemplateVO findLatestTemplateByTypeAndHypervisor(HypervisorType hypervisorType, Storage.TemplateType type);

public Long countTemplatesForAccount(long accountId);

public List<VMTemplateVO> listUnRemovedTemplatesByStates(VirtualMachineTemplate.State ...states);
Expand All @@ -81,4 +84,6 @@ public interface VMTemplateDao extends GenericDao<VMTemplateVO, Long>, StateDao<
void saveDetails(VMTemplateVO tmpl);

List<VMTemplateVO> listByParentTemplatetId(long parentTemplatetId);

VMTemplateVO findLatestTemplateByName(String name);
}
Loading