[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13738430#comment-13738430
 ] 

Tomasz Zieba commented on CLOUDSTACK-904:
-----------------------------------------

The same situation with CitrixXen / XCP but we made a patch:
Environment
- CloudStack 3.0.2
- XCP 1.1

in file: core/src/com/cloud/hypervisor/xen/resource/CitrixRecourceBase.java

public int getOptimalNumberOfCores(int vmCPUsCount) {
        if (vmCPUsCount % 4 == 0) {return 4;} 
        else if (vmCPUsCount % 2 == 0) {return 2;} 
                else return 1;
    }

  protected VM createVmFromTemplate(Connection conn, VirtualMachineTO vmSpec, 
Host host) throws XenAPIException, XmlRpcException {
        String guestOsTypeName = getGuestOsType(vmSpec.getOs(), 
vmSpec.getBootloader() == BootloaderType.CD);
        if ( guestOsTypeName == null ) {
..............
        if (vcpuParams.size() > 0) {
            vm.setVCPUsParams(conn, vcpuParams);
        }


        // change cores per socket according to: 
http://support.citrix.com/article/CTX126524
        if ((long)vmSpec.getCpus() > 1) {
                int optimalCoresCount = 
getOptimalNumberOfCores(vmSpec.getCpus()); 
                
                vm.addToPlatform(conn, "cores-per-socket", 
Integer.toString(optimalCoresCount));
        }  

        
        vm.setActionsAfterCrash(conn, Types.OnCrashBehaviour.DESTROY);
        vm.setActionsAfterShutdown(conn, Types.OnNormalExit.DESTROY);
..............

There is an issue/problem because Microsoft Windows Server Standard is licensed 
to maximum 4 cpus sockets.

                
> CloudStack export the CPU as a socket not core
> ----------------------------------------------
>
>                 Key: CLOUDSTACK-904
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-904
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: KVM
>    Affects Versions: pre-4.0.0, 4.0.0
>            Reporter: Ahmad Saif
>
> I've a VM that's running (Windows 2008 Standard R2 64bit) which was working 
> on a 4 cores offer. when I upgraded the service offer to 8 cores and checked 
> the VM I noticed that it still have only 4 cores !!
> I dig a little bit on the windows machine itself, and found that it see the 
> CPUs as sockets not cores and this version of windows support only up to 4 
> cores.
> when I checked the vm XML file on the host I saw that the CPU is exported as 
> following :
> <vcpu>8</vcpu>
> and it should be exported as following:
> <vcpu>1</vcpu> <cpu>
> <topology sockets='1' cores='8' threads='1'/>
> </cpu>
> otherwise in such systems where you are limited with the sockets number you 
> cannot have the required service offer.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to