Skip to content

Commit

Permalink
[SCVMM] Parse CPUCount into logical_cpus
Browse files Browse the repository at this point in the history
The UI (and other places) use Vm#logical_cpus to indicate the number of CPUs
available in a VM.  Numbers like Vm#hardware#numvcpus and
Vm#hardware#cores_per_socket help determine how Vm#logical_cpus is calculated.

However, in the case of SCVMM there is only on CPUCount value returned when
collecting inventory.  So, defaulting this value to logical_cpus will at least
show the number of CPUs the Vm has available even if the constituent parts are
not known.

https://bugzilla.redhat.com/show_bug.cgi?id=1210657
https://bugzilla.redhat.com/show_bug.cgi?id=1247655
  • Loading branch information
blomquisg committed Aug 14, 2015
1 parent 446f024 commit be379d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/models/ems_refresh/parsers/scvmm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def parse_image(image)
:template => true,
:storages => process_vm_storages(p),
:hardware => {
:numvcpus => p[:CPUCount],
:logical_cpus => p[:CPUCount],
:memory_cpu => normalize_blank_property_num(p[:Memory]),
:cpu_type => p[:CPUType].blank? ? nil : p[:CPUType][:ToString],
:disks => process_disks(p),
Expand Down Expand Up @@ -308,7 +308,7 @@ def process_vm_hardware(vm)
p = vm[:Properties][:Props]

{
:numvcpus => p[:CPUCount],
:logical_cpus => p[:CPUCount],
:guest_os => p[:OperatingSystem][:Props][:Name],
:guest_os_full_name => p[:OperatingSystem][:Props][:Name],
:memory_cpu => normalize_blank_property_num(p[:Memory]),
Expand Down
2 changes: 1 addition & 1 deletion spec/models/ems_refresh/refreshers/scvmm_refresher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def assert_specific_vm
:guest_os => "64-bit edition of Windows Server 2008 R2 Standard",
:guest_os_full_name => "64-bit edition of Windows Server 2008 R2 Standard",
:bios => "67b7b7ae-34aa-474e-9050-02ed3c633f6c",
:numvcpus => 1,
:logical_cpus => 1,
:annotation => nil,
:memory_cpu => 512 # MB
)
Expand Down

0 comments on commit be379d0

Please sign in to comment.