Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f4bd8ab
prevent NPE during ssh key reset
Sep 17, 2020
348b76d
Merge branch 'master' of https://github.com/apache/cloudstack into ck…
Sep 23, 2020
da5e16a
Merge branch 'master' of https://github.com/apache/cloudstack into ck…
Sep 25, 2020
64dc779
Initial Commit - Debian template as replacement for CoreOS
Oct 7, 2020
3fed479
Merge branch 'master' of https://github.com/apache/cloudstack into ck…
Oct 7, 2020
e87b25c
Support for cks nodes to use systemvm template
Oct 9, 2020
f9286d7
Allow usage of systemvm template by other accounts during k8s cluster…
Oct 12, 2020
9adcded
Refactor tests + allow user to use SystemVM template during scaling
Oct 13, 2020
e0120b9
Fix additional master config file
Oct 14, 2020
06a7d36
remove redundant lines
Oct 14, 2020
237981a
Formatted code
Oct 16, 2020
3367e18
temporary checksum update
Oct 20, 2020
d7a3993
change guest os id for xenserver
Oct 20, 2020
d78eb35
Adding public ip to listKubernetesClusterResponse
davidjumani Oct 20, 2020
8e3a25d
Guestos id for vmware
Oct 21, 2020
5888e77
Cleaned up code
Oct 21, 2020
d4c179c
Merge branch 'add-cks-ip' of github.com:shapeblue/cloudstack into cks…
Oct 22, 2020
dbdaf45
Wait for ssh to become available before attaching ISO and template ch…
Oct 23, 2020
013f61f
Merge branch 'master' of https://github.com/apache/cloudstack into ck…
Oct 24, 2020
e4fa75f
Merge branch 'master' of https://github.com/apache/cloudstack into ck…
Oct 27, 2020
92d7271
debug logs
Oct 27, 2020
1d95188
commit addresses systemvm iso not getting attached during bootup
Oct 28, 2020
07eea78
Adding nodeid param in scalekubecluster
davidjumani Sep 17, 2020
039fed5
Changing cks nomenclature
davidjumani Sep 21, 2020
88da9c1
Adding isMaster in KubernetesClusterVmMap
davidjumani Oct 1, 2020
e90b2de
Ensuring we dont remove all masters
davidjumani Oct 1, 2020
f60b33c
Deploying the autoscaler
davidjumani Oct 20, 2020
b9ca4f7
Adding public ip to listKubernetesClusterResponse
davidjumani Oct 20, 2020
4766669
Adding api keys during cluster creation
davidjumani Oct 21, 2020
d703091
Cleanup
davidjumani Oct 22, 2020
6728047
Deploy keys as a secret file
davidjumani Oct 23, 2020
a668a62
Cleanup
davidjumani Oct 23, 2020
4669eb0
Adding smoke tests
davidjumani Oct 25, 2020
0deca68
Allowing for upgrades
davidjumani Oct 27, 2020
cd0f562
Ensure there's always a node during scale down
davidjumani Oct 28, 2020
68b8a32
Tweaking nw rules while scaling
davidjumani Oct 28, 2020
7a37c13
Cleanup
davidjumani Oct 28, 2020
0a53091
Enhancing auytoscaler deployment
davidjumani Oct 29, 2020
59d70d9
Fixing tests
davidjumani Oct 29, 2020
8f0c03c
Refactoring
davidjumani Oct 29, 2020
e65d32a
Adding logs for upgrade failure
davidjumani Oct 29, 2020
41a7eac
More cleanup
davidjumani Oct 29, 2020
31ad3c2
Cleanup + set vmware systemvm template deploy_as_is to 1
Oct 29, 2020
b545d49
Merge branch 'master' of https://github.com/apache/cloudstack into ck…
Oct 30, 2020
ce9774c
fix for systemvm template - deploy as is field
Oct 30, 2020
22bb446
code cleanup
Oct 30, 2020
89877c2
Additional details to support deployment on shared network
Oct 30, 2020
f2bf49c
Limiting max cluster size to global setting KubernetesMaxClusterSize
davidjumani Nov 1, 2020
3bd04bf
Support for shared networks
Oct 30, 2020
201fdda
Merge branch 'add-cks-autoscaling' of github.com:shapeblue/cloudstack…
Nov 2, 2020
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: 2 additions & 0 deletions api/src/main/java/com/cloud/user/AccountService.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,6 @@ UserAccount createUserAccount(String userName, String password, String firstName
UserAccount getUserAccountById(Long userId);

public Map<String, String> getKeys(GetUserKeysCmd cmd);

public Map<String, String> getKeys(Long userId);
}
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)
Map<String, String> templateOvfPropertiesMap, String type)

throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException, StorageUnavailableException, ResourceAllocationException;

Expand Down
4 changes: 4 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 @@ -818,10 +818,14 @@ 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 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 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
Original file line number Diff line number Diff line change
Expand Up @@ -1674,8 +1674,10 @@ protected boolean sendStop(final VirtualMachineGuru guru, final VirtualMachinePr
guru.finalizeStop(profile, answer);
if (vm.getType() == VirtualMachine.Type.User) {
final UserVmVO userVm = _userVmDao.findById(vm.getId());
userVm.setPowerState(PowerState.PowerOff);
_userVmDao.update(userVm.getId(), userVm);
if (userVm != null) {
userVm.setPowerState(PowerState.PowerOff);
_userVmDao.update(userVm.getId(), userVm);
}
}
} else {
s_logger.error("Invalid answer received in response to a StopCommand for " + vm.getInstanceName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ public List<DiskProfile> allocateTemplatedVolumes(Type type, String name, DiskOf
int volumesNumber = 1;
List<DatadiskTO> templateAsIsDisks = null;
String configurationId = null;
if (template.isDeployAsIs()) {
if (template.isDeployAsIs() && vm.getType() != VirtualMachine.Type.SecondaryStorageVm) {
Copy link
Contributor

Choose a reason for hiding this comment

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

please note there is already a specific PR #4437 with this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was added to verify the fix @sureshanaparti

UserVmDetailVO configurationDetail = userVmDetailsDao.findDetail(vm.getId(), VmDetailConstants.DEPLOY_AS_IS_CONFIGURATION);
if (configurationDetail != null) {
configurationId = configurationDetail.getValue();
Expand All @@ -849,7 +849,7 @@ public List<DiskProfile> allocateTemplatedVolumes(Type type, String name, DiskOf
String volumeName = name;
Long volumeSize = rootDisksize;
long deviceId = type.equals(Type.ROOT) ? 0L : 1L;
if (template.isDeployAsIs()) {
if (template.isDeployAsIs() && vm.getType() != VirtualMachine.Type.SecondaryStorageVm) {
int volumeNameSuffix = templateAsIsDisks.get(number).getDiskNumber();
volumeName = String.format("%s-%d", volumeName, volumeNameSuffix);
volumeSize = templateAsIsDisks.get(number).getVirtualSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ private void updateSystemVmTemplates(final Connection conn) {

final Map<Hypervisor.HypervisorType, String> newTemplateChecksum = new HashMap<Hypervisor.HypervisorType, String>() {
{
put(Hypervisor.HypervisorType.KVM, "81b3e48bb934784a13555a43c5ef5ffb");
put(Hypervisor.HypervisorType.XenServer, "1b178a5dbdbe090555515340144c6017");
put(Hypervisor.HypervisorType.VMware, "e6a88e518c57d6f36c096c4204c3417f");
put(Hypervisor.HypervisorType.KVM, "0d95bb3d9385097dec8b485e46eae34b");
put(Hypervisor.HypervisorType.XenServer, "8dd2df4eba815711e68cf204a8df7650");
put(Hypervisor.HypervisorType.VMware, "6d18a4e41589fa32217adb0d0be3d286");
put(Hypervisor.HypervisorType.Hyperv, "5c94da45337cf3e1910dcbe084d4b9ad");
put(Hypervisor.HypervisorType.LXC, "81b3e48bb934784a13555a43c5ef5ffb");
put(Hypervisor.HypervisorType.Ovm3, "875c5c65455fc06c4a012394410db375");
Expand Down
11 changes: 11 additions & 0 deletions engine/schema/src/main/java/com/cloud/vm/UserVmVO.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public class UserVmVO extends VMInstanceVO implements UserVm {
@Column(name = "update_parameters", updatable = true)
protected boolean updateParameters = true;

@Column(name = "user_vm_type", updatable = true)
Copy link
Contributor

Choose a reason for hiding this comment

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

can use "type" from VMInstanceVO instead?

private String userVmType;

transient String password;

@Override
Expand Down Expand Up @@ -125,4 +128,12 @@ public void setUpdateParameters(boolean updateParameters) {
public boolean isUpdateParameters() {
return updateParameters;
}

public String getUserVmType() {
return userVmType;
}

public void setUserVmType(String userVmType) {
this.userVmType = userVmType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -833,3 +833,15 @@ INSERT INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_vers

-- Fix OS category for Guest OS 'Other PV Virtio-SCSI (64-bit)'
UPDATE `cloud`.`guest_os` SET category_id = 7 WHERE id = 275 AND display_name = 'Other PV Virtio-SCSI (64-bit)';

-- TODO : Move to 4.16
ALTER TABLE `cloud`.`user_vm` ADD COLUMN `user_vm_type` varchar(255) DEFAULT "UserVM" COMMENT 'Defines the type of UserVM';
Copy link
Contributor

Choose a reason for hiding this comment

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

@Pearl1594 is this not redundant of Type column in vm_instance table? This type column already used to persist different system VMs (ConsoleProxy, SecondaryStorageVm, DomainRouter), may be you can use this for different user VMs as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intention of adding a user vm type - as a sub-type of VMInstance type - User is to basically reduce any regression - changing User to other type to accommodate CKS / K8s nodes would possibly require a lot more changes

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok @Pearl1594 I think it is better to use single source for defining the instance type.


UPDATE `cloud`.`vm_template` set deploy_as_is = 1 where id = 8;

ALTER TABLE `cloud`.`kubernetes_cluster` ADD COLUMN `autoscaling_enabled` tinyint(1) unsigned NOT NULL DEFAULT 0;
ALTER TABLE `cloud`.`kubernetes_cluster` ADD COLUMN `minsize` bigint;
ALTER TABLE `cloud`.`kubernetes_cluster` ADD COLUMN `maxsize` bigint;

ALTER TABLE `cloud`.`kubernetes_cluster_vm_map` ADD COLUMN `is_master` tinyint(1) unsigned NOT NULL DEFAULT 0;

Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,7 @@ public Answer execute(final StartCommand command, final LibvirtComputingResource
libvirtComputingResource.applyDefaultNetworkRules(conn, vmSpec, false);

// pass cmdline info to system vms
if (vmSpec.getType() != VirtualMachine.Type.User) {
String controlIp = null;
for (final NicTO nic : vmSpec.getNics()) {
if (nic.getType() == TrafficType.Control) {
controlIp = nic.getIp();
break;
}
}
if (vmSpec.getType() != VirtualMachine.Type.User || (vmSpec.getBootArgs() != null && vmSpec.getBootArgs().contains("CKSNode"))) {
// try to patch and SSH into the systemvm for up to 5 minutes
for (int count = 0; count < 10; count++) {
// wait and try passCmdLine for 30 seconds at most for CLOUDSTACK-2823
Expand All @@ -104,12 +97,22 @@ public Answer execute(final StartCommand command, final LibvirtComputingResource
}
}

final VirtualRoutingResource virtRouterResource = libvirtComputingResource.getVirtRouterResource();
// check if the router is up?
for (int count = 0; count < 60; count++) {
final boolean result = virtRouterResource.connect(controlIp, 1, 5000);
if (result) {
break;
if (vmSpec.getType() != VirtualMachine.Type.User) {
String controlIp = null;
for (final NicTO nic : vmSpec.getNics()) {
if (nic.getType() == TrafficType.Control) {
controlIp = nic.getIp();
break;
}
}

final VirtualRoutingResource virtRouterResource = libvirtComputingResource.getVirtRouterResource();
// check if the router is up?
for (int count = 0; count < 60; count++) {
final boolean result = virtRouterResource.connect(controlIp, 1, 5000);
if (result) {
break;
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ enum Event {
StopRequested,
DestroyRequested,
RecoveryRequested,
AutoscaleRequested,
ScaleUpRequested,
ScaleDownRequested,
UpgradeRequested,
Expand Down Expand Up @@ -81,6 +82,7 @@ enum State {

s_fsm.addTransition(State.Running, Event.FaultsDetected, State.Alert);

s_fsm.addTransition(State.Running, Event.AutoscaleRequested, State.Scaling);
s_fsm.addTransition(State.Running, Event.ScaleUpRequested, State.Scaling);
s_fsm.addTransition(State.Running, Event.ScaleDownRequested, State.Scaling);
s_fsm.addTransition(State.Scaling, Event.OperationSucceeded, State.Running);
Expand Down Expand Up @@ -131,4 +133,7 @@ enum State {
@Override
State getState();
Date getCreated();
boolean getAutoscalingEnabled();
Long getMinSize();
Long getMaxSize();
}
Loading