Revision 4888a609

b/lib/constants.py
827 827
HV_CPU_TYPE = "cpu_type"
828 828
HV_CPU_CAP = "cpu_cap"
829 829
HV_CPU_WEIGHT = "cpu_weight"
830
HV_CPU_CORES = "cpu_cores"
831
HV_CPU_THREADS = "cpu_threads"
832
HV_CPU_SOCKETS = "cpu_sockets"
830 833

  
831 834

  
832 835
HVS_PARAMETER_TYPES = {
......
887 890
  HV_CPU_TYPE: VTYPE_STRING,
888 891
  HV_CPU_CAP: VTYPE_INT,
889 892
  HV_CPU_WEIGHT: VTYPE_INT,
893
  HV_CPU_CORES: VTYPE_INT,
894
  HV_CPU_THREADS: VTYPE_INT,
895
  HV_CPU_SOCKETS: VTYPE_INT,
890 896
  }
891 897

  
892 898
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
......
1951 1957
    HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED,
1952 1958
    HV_CPU_MASK: CPU_PINNING_ALL,
1953 1959
    HV_CPU_TYPE: "",
1960
    HV_CPU_CORES: 0,
1961
    HV_CPU_THREADS: 0,
1962
    HV_CPU_SOCKETS: 0,
1954 1963
    },
1955 1964
  HT_FAKE: {},
1956 1965
  HT_CHROOT: {
b/lib/hypervisor/hv_kvm.py
532 532
      hv_base.ParamInSet(True, constants.REBOOT_BEHAVIORS),
533 533
    constants.HV_CPU_MASK: hv_base.OPT_MULTI_CPU_MASK_CHECK,
534 534
    constants.HV_CPU_TYPE: hv_base.NO_CHECK,
535
    constants.HV_CPU_CORES: hv_base.NO_CHECK,
536
    constants.HV_CPU_THREADS: hv_base.NO_CHECK,
537
    constants.HV_CPU_SOCKETS: hv_base.NO_CHECK,
535 538
    }
536 539

  
537 540
  _MIGRATION_STATUS_RE = re.compile("Migration\s+status:\s+(\w+)",
......
617 620
      elif arg == "-m":
618 621
        memory = int(arg_list.pop(0))
619 622
      elif arg == "-smp":
620
        vcpus = int(arg_list.pop(0))
623
        vcpus = int(arg_list.pop(0).split(",")[0])
621 624

  
622 625
    if instance is None:
623 626
      raise errors.HypervisorError("Pid %s doesn't contain a ganeti kvm"
......
1000 1003
        done in L{_ExecuteKVMRuntime}
1001 1004

  
1002 1005
    """
1003
    # pylint: disable=R0914,R0915
1006
    # pylint: disable=R0912,R0914,R0915
1004 1007
    _, v_major, v_min, _ = self._GetKVMVersion()
1008
    hvp = instance.hvparams
1005 1009

  
1006 1010
    pidfile = self._InstancePidFile(instance.name)
1007 1011
    kvm = constants.KVM_PATH
......
1010 1014
    # used just by the vnc server, if enabled
1011 1015
    kvm_cmd.extend(["-name", instance.name])
1012 1016
    kvm_cmd.extend(["-m", instance.beparams[constants.BE_MAXMEM]])
1013
    kvm_cmd.extend(["-smp", instance.beparams[constants.BE_VCPUS]])
1017

  
1018
    smp_list = ["%s" % instance.beparams[constants.BE_VCPUS]]
1019
    if hvp[constants.HV_CPU_CORES]:
1020
      smp_list.append("cores=%s" % hvp[constants.HV_CPU_CORES])
1021
    if hvp[constants.HV_CPU_THREADS]:
1022
      smp_list.append("threads=%s" % hvp[constants.HV_CPU_THREADS])
1023
    if hvp[constants.HV_CPU_SOCKETS]:
1024
      smp_list.append("sockets=%s" % hvp[constants.HV_CPU_SOCKETS])
1025

  
1026
    kvm_cmd.extend(["-smp", ",".join(smp_list)])
1027

  
1014 1028
    kvm_cmd.extend(["-pidfile", pidfile])
1015 1029
    kvm_cmd.extend(["-balloon", "virtio"])
1016 1030
    kvm_cmd.extend(["-daemonize"])
......
1020 1034
        constants.INSTANCE_REBOOT_EXIT:
1021 1035
      kvm_cmd.extend(["-no-reboot"])
1022 1036

  
1023
    hvp = instance.hvparams
1024 1037
    kernel_path = hvp[constants.HV_KERNEL_PATH]
1025 1038
    if kernel_path:
1026 1039
      boot_disk = boot_cdrom = boot_floppy = boot_network = False
b/man/gnt-instance.rst
634 634

  
635 635
    It is set to ``reboot`` by default.
636 636

  
637
cpu\_cores
638
    Valid for the KVM hypervisor.
639

  
640
    Number of emulated CPU cores.
641

  
642
cpu\_threads
643
    Valid for the KVM hypervisor.
644

  
645
    Number of emulated CPU threads.
646

  
647
cpu\_sockets
648
    Valid for the KVM hypervisor.
649

  
650
    Number of emulated CPU sockets.
651

  
637 652

  
638 653
The ``-O (--os-parameters)`` option allows customisation of the OS
639 654
parameters. The actual parameter names and values depends on the OS

Also available in: Unified diff