-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixed failed to start instances on Xenserver with dynamic scaling due to default max cpus. #4447
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
Fixed failed to start instances on Xenserver with dynamic scaling due to default max cpus. #4447
Conversation
|
@blueorangutan package |
|
@Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2336 |
|
@blueorangutan test centos7 xcpng76 |
|
@Spaceman1984 a Trillian-Jenkins test job (centos7 mgmt + xcpng76) has been kicked to run smoke tests |
| to.setVcpuMaxLimit(MaxNumberOfVCPUSPerVM.valueIn(host.getClusterId())); | ||
| // Max cpu cannot be more than host capability | ||
| if (host.getCpus() < MaxNumberOfVCPUSPerVM.valueIn(host.getClusterId())) | ||
| to.setVcpuMaxLimit(host.getCpus()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think host.getCpus() get the actual CPU on the physical host, but xenserver host is capable of allocating virtual CPUs more than the actual count.
Here is the list of configuration limits for XS 7.1 version. https://docs.citrix.com/en-us/xenserver/7-1/system-requirements/configuration-limits.html
It says "Virtual CPUs per VM (Linux)" 32. So we might need to set the value according to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with a host with 8 CPUs and it failed trying to allocate 16 on XCP-ng 7.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do some testing on Xenserver
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like overcommitting CPU on Xenserver was removed according to this article @harikrishna-patnala https://support.citrix.com/article/CTX236977
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Spaceman1984 got it, thanks for the article and yes it seems over committing CPU is disabled.
Do you think we have to also provide some global config "vcpu-unrestricted" to allow overcommit of CPU like xenserver does this way "xe vm-param-set uuid= platform:vcpu-unrestricted=true". This gives admins to choose whether to overcommit or not.
Otherwise If we have to go with by setting only actual pCPUs, we need to remove this configuration parameter "xen.vm.vcpu.max" as we dont need it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the global var in to allow things like if you have a host with 32 pCPUs but want to set a lower max vCPU limit for a VM for the purpose of dynamic scaling.
As for the ability to force overcommit - This is not recommended in the article and I would think not best practice, that's why I would vote no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please put a log message which explans why we are setting that value, otherwise user may think why a different value is set other than "xen.vm.vcpu.max"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, awesome, on it.
|
@blueorangutan package |
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2337 |
|
@blueorangutan test centos7 xcpng76 |
|
@Spaceman1984 a Trillian-Jenkins test job (centos7 mgmt + xcpng76) has been kicked to run smoke tests |
|
Trillian test result (tid-3130)
|
|
looking by the discussion here, we should move this to 4.16 and make a good functional definition of what is and isn't possible on different xen platforms. |
|
Trillian test result (tid-3131)
|
ping @Spaceman1984 @harikrishna-patnala . cc @rhtyd |
|
@DaanHoogland I have determined this PR is related to #4443, I will merge this branch into that one and then close this PR. |
@DaanHoogland agreed to keep it for 4.16 since this makes a substantial change in the existing flow or values assigned. |


Description
When trying to start an instance with dynamic scaling on a Xenserver Hypervisor with less than 16 cores, the VM fails to start. This is due to the default max value being set to 16. This PR limits the max vCPUs to what the host is capable of.
Types of changes
Screenshots (if appropriate):
How Has This Been Tested?
Set enable.dynamic.scale.vm to true
Try to start an instance on a Xenserver host with less than 16 cores.