Change in vdsm[master]: [RFE] set the # of vcpus for a VM (hot plug/unplug)

rgolan at redhat.com rgolan at redhat.com
Thu Jan 9 10:17:21 UTC 2014


Roy Golan has posted comments on this change.

Change subject: [RFE] set the # of vcpus for a VM (hot plug/unplug)
......................................................................


Patch Set 18:

(4 comments)

....................................................
File vdsm/vm.py
Line 898:         self.dom.appendChildWithArgs('currentMemory', text=memSizeKB)
Line 899:         smp = self.conf.get('smp', 1)
Line 900:         vcpu = self.dom.appendChildWithArgs(
Line 901:             'vcpu', text=self.conf.get('maxVCpus', smp))
Line 902:         # hotplug cpu requires a maximum number which is higher than the static
Done
Line 903:         # assignment. 160 is the max number of cpu's for a guest
Line 904:         # see http://www.ovirt.org/Hot_plug_cpu
Line 905:         vcpu.setAttrs(**{'current': smp, 'placement': 'static'})
Line 906: 


Line 901:             'vcpu', text=self.conf.get('maxVCpus', smp))
Line 902:         # hotplug cpu requires a maximum number which is higher than the static
Line 903:         # assignment. 160 is the max number of cpu's for a guest
Line 904:         # see http://www.ovirt.org/Hot_plug_cpu
Line 905:         vcpu.setAttrs(**{'current': smp, 'placement': 'static'})
Done
Line 906: 
Line 907:         memSizeGuaranteedKB = str(1024 * int(
Line 908:             self.conf.get('memGuaranteedSize', '0')
Line 909:         ))


Line 1056:                 cpu.appendChildWithArgs('feature', **featureAttrs)
Line 1057: 
Line 1058:         if ('smpCoresPerSocket' in self.conf or
Line 1059:                 'smpThreadsPerCore' in self.conf):
Line 1060:             maxVCpus = int(self.conf.get('maxVCpus', '160'))
Done
Line 1061:             cores = int(self.conf.get('smpCoresPerSocket', '1'))
Line 1062:             threads = int(self.conf.get('smpThreadsPerCore', '1'))
Line 1063:             cpu.appendChildWithArgs('topology',
Line 1064:                                     sockets=str(maxVCpus / cores / threads),


Line 3386:         except libvirt.libvirtError as e:
Line 3387:             self.log.error("setNumberOfCpus failed", exc_info=True)
Line 3388:             if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
Line 3389:                 return errCode['noVM']
Line 3390:             return {'status': {'code': errCode['setNumberOfCpusErr /']
Done
Line 3391:                     ['status']['code'], 'message': e.message}}
Line 3392: 
Line 3393:         self.saveState()
Line 3394:         hooks.after_set_num_of_cpus()


-- 
To view, visit http://gerrit.ovirt.org/21789
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ief35e1d335737cd98d21a5413ac9f8ab9d824c3e
Gerrit-PatchSet: 18
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Michal Skrivanek <michal.skrivanek at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list