Skip to content

VM deployment heuristsics - #29

Closed
dhlaluku wants to merge 1 commit into
masterfrom
vm-deployment-heuristics
Closed

VM deployment heuristsics#29
dhlaluku wants to merge 1 commit into
masterfrom
vm-deployment-heuristics

Conversation

@dhlaluku

@dhlalukudhlaluku commented Feb 7, 2019

Copy link
Copy Markdown

Description

VM deployment;
Allow users to choose a pod, cluster, and host when deploying a VM instance

FR Doc: https://shapeblue.sharepoint.com/:w:/r/Shared%20Documents/Development/Roadmap/FR%20Documents/VM%20Deployment%20Planner/DeploymentPlannerFR.docx?d=w0079dc479ca5446985cbb9226a14a08b&csf=1&e=EsWcnl

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Screenshots (if appropriate):

image

How Has This Been Tested?

@dhlalukudhlaluku changed the title Vm deployment heauristsicsVM deployment heauristsicsFeb 7, 2019
@dhlaluku
dhlalukuforce-pushed the vm-deployment-heuristics branch from 201786b to e1336ffCompareFebruary 7, 2019 13:40
@dhlalukudhlaluku self-assigned this Feb 15, 2019
@dhlaluku

Copy link
Copy Markdown
Author

@borisstoyanov I am working on the Marvin tests for this PR and would like some suggestions around negative test cases. Thanks in advance /CC @DaanHoogland

@DaanHooglandDaanHoogland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code looks good, i have some functional doubt, though.

Comment threadserver/src/main/java/com/cloud/vm/UserVmManagerImpl.java
Account account = CallContext.current().getCallingAccount();
boolean isRootAdmin = _accountService.isRootAdmin(account.getId());

Pod destinationPod = getDestinationPod(podId, isRootAdmin);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what if,
the user passed a pod, ...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

pod will be chosen for the deployment if cluster and host have not been specified.

boolean isRootAdmin = _accountService.isRootAdmin(account.getId());

Pod destinationPod = getDestinationPod(podId, isRootAdmin);
Cluster destinationCluster = getDestinationCluster(clusterId, isRootAdmin);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

... and then passes a cluster that is not in the passed pod, ...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

see comment below


Pod destinationPod = getDestinationPod(podId, isRootAdmin);
Cluster destinationCluster = getDestinationCluster(clusterId, isRootAdmin);
Host destinationHost = getDestinationHost(hostId, isRootAdmin);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

and next passes a host that is not in the passed cluster?

@dhlalukudhlalukuFeb 21, 2019

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have simplified this to by using an if-else if block that checks from the lowest unit (host), followed cluster if host is not specified, and lastly pod.
if (host != null){ planner = host planner } else if(cluster != null) { planner = cluster planner }else if(pod != null) { planner = pod planner }

Removed the validation that checks the parent-child relations between pod, cluster and host

return vmParamPair;
}

private void validateDeploymentDestination(Pod destinationPod, Cluster destinationCluster, Host destinationHost) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would rather have that the user would be able to pass either a pod, or a cluster, or a host. the smaller implies the bigger and makes it redundant as parameter.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This validation is not necessary since we take the lowest unit supplied and use that for the deployment.

Check has been removed


Cluster destinationCluster = null;
if (clusterId != null) {
if (!isRootAdmin) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

so a user can not specify a cluster they have acces to?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This feature is only available to Admin users. (Root and Domain)

@DaanHooglandDaanHoogland changed the title VM deployment heauristsicsVM deployment heuristsicsFeb 15, 2019
@dhlaluku

Copy link
Copy Markdown
Author

@DaanHoogland thanks for the review, I will look your comments and address as requested.

@dhlaluku
dhlalukuforce-pushed the vm-deployment-heuristics branch from 87d8ca4 to 3f42254CompareFebruary 20, 2019 13:09
@dhlaluku
dhlalukuforce-pushed the vm-deployment-heuristics branch 2 times, most recently from 2f765d1 to 24194c2CompareMarch 12, 2019 08:05
@dhlaluku
dhlalukuforce-pushed the vm-deployment-heuristics branch from 234bdaa to 989d51eCompareMarch 20, 2019 14:13
@anuragaw
anuragawforce-pushed the vm-deployment-heuristics branch from 989d51e to e3886d9CompareMay 9, 2019 08:22
@anuragaw

Copy link
Copy Markdown

Fixed some bugs that were found and some that I observed in code. Also rebased against latest master.

Currently an admin can choose which host a VM is to be started on.
They should be able to 'override' the allocation algorthm to a greater
or lesser extent at will, and be able to choose the pod, cluster or host
that they wish a new VM to be deployed in.
DeployVirtualMachine API has been extended with additional, optional
parameters podid and clusterid that will be passed to and used in the
deployment planner, when selecting a viable host. If the user supplies
a pod, a suitable host in the given pod will be selected. If the user
supplies a cluster, a suitable host in the given cluster will be selected.
Based on the parameter supplied and on passing validation, the VM will
then be deployed on the selected host, cluster or pod.
@anuragaw
anuragawforce-pushed the vm-deployment-heuristics branch from e3886d9 to db8172bCompareJuly 2, 2019 05:59
@anuragaw

Copy link
Copy Markdown

Had lost track of this last thing on this PR. Rebased against master.
Based on discussions with @PaulAngus we need to rebase, clean up the PR and open a community PR.
CC/ @rhtyd , @borisstoyanov

@anuragawanuragaw closed this Jul 2, 2019
yadvr pushed a commit that referenced this pull request Jan 20, 2021
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@dhlaluku@anuragaw@DaanHoogland