You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/09/01 16:11:18 UTC

[GitHub] [cloudstack] Hudratronium opened a new issue, #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Hudratronium opened a new issue, #6680:
URL: https://github.com/apache/cloudstack/issues/6680

   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and main branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   CS Agent
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on main branch.
   -->
   
   ~~~
   4.17.0.1
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, advanced networking, etc.  N/A otherwise
   -->
   
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   Host OS:     Ubuntu 20.04.5 LTS
   Hypervisor: KVM
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   After upgradeing existing agents from 4.16.1 to 4.17.0.1 the retrieval of the CPU Speed fails. Nevertheless the Agents reports CPU Speeds which seem to be the actual running speed of the cores, not the potentially max. availeable speed of the CPU.
   
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   
   Upgarde existing CS Agent from 4.16.1 to 4.17.0.1
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   CPU Speeds are retrieved for the max. availeable CPU speeds
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   Agent is reporting "live" CPU Speed; Error out of agent.log
   
   2022-08-28 13:36:51,849 INFO  [utils.linux.KVMHostInfo] (Agent-Handler-1:null) (logid:) Fetching CPU speed from command "lscpu".
   2022-08-28 13:36:51,858 ERROR [utils.linux.KVMHostInfo] (Agent-Handler-1:null) (logid:) Unable to retrieve the CPU speed from lscpu.
   java.lang.NullPointerException
           at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1838)
           at java.base/jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
           at java.base/java.lang.Float.parseFloat(Float.java:455)
           at org.apache.cloudstack.utils.linux.KVMHostInfo.getCpuSpeedFromCommandLscpu(KVMHostInfo.java:107)
           at org.apache.cloudstack.utils.linux.KVMHostInfo.getCpuSpeed(KVMHostInfo.java:87)
           at org.apache.cloudstack.utils.linux.KVMHostInfo.getHostInfoFromLibvirt(KVMHostInfo.java:133)
           at org.apache.cloudstack.utils.linux.KVMHostInfo.<init>(KVMHostInfo.java:53)
           at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.initialize(LibvirtComputingResource.java:3373)
           at com.cloud.agent.Agent.sendStartup(Agent.java:441)
           at com.cloud.agent.Agent$ServerHandler.doTask(Agent.java:1099)
           at com.cloud.utils.nio.Task.call(Task.java:83)
           at com.cloud.utils.nio.Task.call(Task.java:29)
           at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
           at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
           at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
           at java.base/java.lang.Thread.run(Thread.java:829)
   2022-08-28 13:36:51,859 INFO  [utils.linux.KVMHostInfo] (Agent-Handler-1:null) (logid:) Fetching CPU speed from file [/sys/devices/system/cpu/cpu0/cpufreq/base_frequency].
   2022-08-28 13:36:51,860 ERROR [utils.linux.KVMHostInfo] (Agent-Handler-1:null) (logid:) Unable to retrieve the CPU speed from file [/sys/devices/system/cpu/cpu0/cpufreq/base_frequency]
   java.io.FileNotFoundException: /sys/devices/system/cpu/cpu0/cpufreq/base_frequency (No such file or directory)
           at java.base/java.io.FileInputStream.open0(Native Method)
           at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
           at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
           at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
           at java.base/java.io.FileReader.<init>(FileReader.java:60)
           at org.apache.cloudstack.utils.linux.KVMHostInfo.getCpuSpeedFromFile(KVMHostInfo.java:118)
           at org.apache.cloudstack.utils.linux.KVMHostInfo.getCpuSpeed(KVMHostInfo.java:92)
           at org.apache.cloudstack.utils.linux.KVMHostInfo.getHostInfoFromLibvirt(KVMHostInfo.java:133)
           at org.apache.cloudstack.utils.linux.KVMHostInfo.<init>(KVMHostInfo.java:53)
           at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.initialize(LibvirtComputingResource.java:3373)
           at com.cloud.agent.Agent.sendStartup(Agent.java:441)
           at com.cloud.agent.Agent$ServerHandler.doTask(Agent.java:1099)
           at com.cloud.utils.nio.Task.call(Task.java:83)
           at com.cloud.utils.nio.Task.call(Task.java:29)
           at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
           at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
           at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
           at java.base/java.lang.Thread.run(Thread.java:829)
   2022-08-28 13:36:51,860 INFO  [utils.linux.KVMHostInfo] (Agent-Handler-1:null) (logid:) Using the value [1803] provided by Libvirt.
   ~~~
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Hudratronium commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
Hudratronium commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1231423029

   @shwstppr 
   The behaviour has changed as since the upgrade the reported values "changed" to the current cpu speeds. That hasn't been the case in our installation from 4.15. onwards - including the upgrades / restarts of hosts - thats why i was so suprised. That leaded to a situation that
   1. Service Offerings haven't been working anymore (couldn't find useable hosts as the cpu speed was way to low)
   2. Migration tasks failed as no suitable hosts were availeable anymore 
   Biggest problem for our usecase: "HA-Features" wouldn't be working in this situation
   
   "Workaround" for us was to set the `host.cpu.manual.speed.mhz` option in the agent.conf manually for our hosts.
   
   Regarding the outputs for the different checks performed by the agent:
   1. LSCPU script seems not to be working with AMD CPUs, as the "speed" isn't part of the name. lscpu would deliver correct values never the less - but one would need to check those / choose the "right" ones
   2. File is not availeable under Ubuntu 20.04 - at least for my AMD devices. I could offer something like `cpuinfo_max_freq` :-D
   3. The value from libvirt - which seemed to be kind of variable - was way off. As i don't know how / which value is used i can't really give a impression what values are returned. From our findings the scope was between 1,3GHz up to 2,7Ghz. All Hosts with the same CPU Modell and same "host"-configuration.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1235233415

   > @weizhouapache `virsh capabilities` seem a better option as with my system I get `CPU max MHz: 4100.0000` from lscpu while virsh capabilities return the correct value,
   > 
   > ```
   > ⇒  virsh capabilities 
   > <capabilities>
   > 
   >   <host>
   >     <uuid>3956624c-2d45-11b2-a85c-dca73c02f24f</uuid>
   >     <cpu>
   >       <arch>x86_64</arch>
   >       <model>Skylake-Client-noTSX-IBRS</model>
   >       <vendor>Intel</vendor>
   >       <microcode version='240'/>
   >       <counter name='tsc' frequency='2207998000' scaling='no'/>
   > ```
   
   @shwstppr 
   good finding !
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1231620757

   @Hudratronium I checked the diff between 4.16.1 and 4.17.0 again and it seems the 2nd method(finding CPU frequency from file) used has changed. Earlier code used to check file `/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` but now it checks `/sys/devices/system/cpu/cpu0/cpufreq/base_frequency`. Maybe that caused the difference for you.
   Can you check if `/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` is present on your host and if has the desired value?
   
   As you mentioned setting option in agent.conf fixes it for you, maybe we can update the documentation?
   cc @nvazquez 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1235166817

   @weizhouapache `virsh capabilities` seem a better option as with my system I get `CPU max MHz:                     4100.0000` from lscpu while virsh capabilities return the correct value,
   ```
   ⇒  virsh capabilities 
   <capabilities>
   
     <host>
       <uuid>3956624c-2d45-11b2-a85c-dca73c02f24f</uuid>
       <cpu>
         <arch>x86_64</arch>
         <model>Skylake-Client-noTSX-IBRS</model>
         <vendor>Intel</vendor>
         <microcode version='240'/>
         <counter name='tsc' frequency='2207998000' scaling='no'/>
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Hudratronium commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
Hudratronium commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1234492354

   @shwstppr 
   
   Will try to give as much inforamtion as possible:
   
   lscpu
   ~~~
   Architecture:                    x86_64
   CPU op-mode(s):                  32-bit, 64-bit
   Byte Order:                      Little Endian
   Address sizes:                   48 bits physical, 48 bits virtual
   CPU(s):                          48
   On-line CPU(s) list:             0-47
   Thread(s) per core:              2
   Core(s) per socket:              24
   Socket(s):                       1
   NUMA node(s):                    1
   Vendor ID:                       AuthenticAMD
   CPU family:                      25
   Model:                           1
   Model name:                      AMD EPYC 7413 24-Core Processor
   Stepping:                        1
   Frequency boost:                 enabled
   CPU MHz:                         2892.925
   CPU max MHz:                     2650.0000
   CPU min MHz:                     1500.0000
   BogoMIPS:                        5289.83
   Virtualization:                  AMD-V
   ~~~
   
   virsh nodeinfo
   ~~~
   CPU model:           x86_64
   CPU(s):              48
   CPU frequency:       1494 MHz
   CPU socket(s):       1
   Core(s) per socket:  24
   Thread(s) per core:  2
   NUMA cell(s):        1
   Memory size:         263476088 KiB
   ~~~
   
   virsh sysinfo
   ~~~
   <sysinfo type='smbios'>
     <processor>
       <entry name='socket_destination'>CPU1</entry>
       <entry name='type'>Central Processor</entry>
       <entry name='family'>Zen</entry>
       <entry name='manufacturer'>AMD</entry>
       <entry name='signature'>Family 25, Model 1, Stepping 1</entry>
       <entry name='version'>AMD EPYC 7413 24-Core Processor</entry>
       <entry name='external_clock'>2000 MHz</entry>
       <entry name='max_speed'>3900 MHz</entry>
       <entry name='status'>Populated, Enabled</entry>
       <entry name='serial_number'>Not Specified</entry>
       <entry name='part_number'>Not Specified</entry>
     </processor>
   </sysinfo>
   ~~~
   
   virsh capabilities
   ~~~
   <capabilities>
     <host>
       <cpu>
         <arch>x86_64</arch>
         <model>EPYC-Rome</model>
         <vendor>AMD</vendor>
         <microcode version='167776605'/>
         <counter name='tsc' frequency='2645030000'/>
         <topology sockets='1' cores='24' threads='2'/>
         <pages unit='KiB' size='4'/>
         <pages unit='KiB' size='2048'/>
         <pages unit='KiB' size='1048576'/>
       </cpu>
     </host>
   </capabilities>
   ~~~
   
   The problem in this case might be, that the availeable output seems to connected to the used module for the cpu. As mentioned above lscpu using the `intel_pstate` module will give different sets of results. Currently, as i am using a standard Ubuntu Server 20.04.5, the out-of-the-box used module is `acpi-cpufreq`. Which supports the `CPU max MHz`. On the horizon, when the kernel version 5.17 will be used, out-of-the-box we shall see the module `amd_pstat`... 
   I don't know how important the "out-of-the-box" CPU discovery is for the cloudstack agent. Guess there would be a little script needed to check the loaded module and then "query" the intended value... How ever - depending on how important this is.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] weizhouapache commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
weizhouapache commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1235153443

   > @shwstppr
   > 
   > Will try to give as much inforamtion as possible:
   > 
   > lscpu
   > 
   > ```
   > Architecture:                    x86_64
   > CPU op-mode(s):                  32-bit, 64-bit
   > Byte Order:                      Little Endian
   > Address sizes:                   48 bits physical, 48 bits virtual
   > CPU(s):                          48
   > On-line CPU(s) list:             0-47
   > Thread(s) per core:              2
   > Core(s) per socket:              24
   > Socket(s):                       1
   > NUMA node(s):                    1
   > Vendor ID:                       AuthenticAMD
   > CPU family:                      25
   > Model:                           1
   > Model name:                      AMD EPYC 7413 24-Core Processor
   > Stepping:                        1
   > Frequency boost:                 enabled
   > CPU MHz:                         2892.925
   > CPU max MHz:                     2650.0000
   > CPU min MHz:                     1500.0000
   > BogoMIPS:                        5289.83
   > Virtualization:                  AMD-V
   > ```
   > 
   > virsh nodeinfo
   > 
   > ```
   > CPU model:           x86_64
   > CPU(s):              48
   > CPU frequency:       1494 MHz
   > CPU socket(s):       1
   > Core(s) per socket:  24
   > Thread(s) per core:  2
   > NUMA cell(s):        1
   > Memory size:         263476088 KiB
   > ```
   > 
   > virsh sysinfo
   > 
   > ```
   > <sysinfo type='smbios'>
   >   <processor>
   >     <entry name='socket_destination'>CPU1</entry>
   >     <entry name='type'>Central Processor</entry>
   >     <entry name='family'>Zen</entry>
   >     <entry name='manufacturer'>AMD</entry>
   >     <entry name='signature'>Family 25, Model 1, Stepping 1</entry>
   >     <entry name='version'>AMD EPYC 7413 24-Core Processor</entry>
   >     <entry name='external_clock'>2000 MHz</entry>
   >     <entry name='max_speed'>3900 MHz</entry>
   >     <entry name='status'>Populated, Enabled</entry>
   >     <entry name='serial_number'>Not Specified</entry>
   >     <entry name='part_number'>Not Specified</entry>
   >   </processor>
   > </sysinfo>
   > ```
   > 
   > virsh capabilities
   > 
   > ```
   > <capabilities>
   >   <host>
   >     <cpu>
   >       <arch>x86_64</arch>
   >       <model>EPYC-Rome</model>
   >       <vendor>AMD</vendor>
   >       <microcode version='167776605'/>
   >       <counter name='tsc' frequency='2645030000'/>
   >       <topology sockets='1' cores='24' threads='2'/>
   >       <pages unit='KiB' size='4'/>
   >       <pages unit='KiB' size='2048'/>
   >       <pages unit='KiB' size='1048576'/>
   >     </cpu>
   >   </host>
   > </capabilities>
   > ```
   > 
   > The problem in this case might be, that the availeable output seems to connected to the used module for the cpu. As mentioned above lscpu using the `intel_pstate` module will give different sets of results. Currently, as i am using a standard Ubuntu Server 20.04.5, the out-of-the-box used module is `acpi-cpufreq`. Which supports the `CPU max MHz`. On the horizon, when the kernel version 5.17 will be used, out-of-the-box we shall see the module `amd_pstat`... I don't know how important the "out-of-the-box" CPU discovery is for the cloudstack agent. Guess there would be a little script needed to check the loaded module and then "query" the intended value... How ever - depending on how important this is.
   
   thanks @Hudratronium 
   
   it looks we could get correct value by `lscpu` or `virsh capabilities`
   
   CPU max MHz:                     2650.0000
   
         <counter name='tsc' frequency='2645030000'/>
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1238012879

   Fixed with #6696 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr closed issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
shwstppr closed issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1
URL: https://github.com/apache/cloudstack/issues/6680


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Hudratronium commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
Hudratronium commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1230336042

   Thanks for your support anyway.
   Seems like this is the case.... Strange thing after a 'mere' update to encounter though.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Hudratronium closed issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
Hudratronium closed issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1
URL: https://github.com/apache/cloudstack/issues/6680


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1233950653

   @Hudratronium can you please share complete output of `lscpu` so maybe we can check if it can use some other regex like CPU MHz or CPU max MHz from below,
   ```
   ⇒  lscpu                                
   Architecture:                    x86_64
   CPU op-mode(s):                  32-bit, 64-bit
   Byte Order:                      Little Endian
   Address sizes:                   39 bits physical, 48 bits virtual
   CPU(s):                          12
   On-line CPU(s) list:             0-11
   Thread(s) per core:              2
   Core(s) per socket:              6
   Socket(s):                       1
   NUMA node(s):                    1
   Vendor ID:                       GenuineIntel
   CPU family:                      6
   Model:                           158
   Model name:                      Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
   Stepping:                        10
   CPU MHz:                         900.006
   CPU max MHz:                     4100.0000
   CPU min MHz:                     800.0000
   BogoMIPS:                        4399.99
   ```
   
   Also, output of:
   `virsh nodeinfo`
   `virsh sysinfo`
   `virsh capabilities`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Hudratronium commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
Hudratronium commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1230245058

   lscpu is working as expected on the hosts.
   The part of the script you provides is executed, giving no result. And no error.
   
   But from my little knoledge this script will not give you any "Speeds" as you only "grep" the Model name and pipe the "model name" / the line with the modelname for further usage. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] s-seitz commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
s-seitz commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1230199030

   cpu speed is first gathered via a tiny script, before looking for ```base_frequency```.
   
   Just make sure, ```lscpu | grep -i 'Model name' | head -n 1 | egrep -o '[[:digit:]].[[:digit:]]+GHz' | sed 's/GHz//g'``` works on your kvm-nodes.
   Most likely, you forgot to install lscpu?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] s-seitz commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
s-seitz commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1230278459

   I can confirm it works. At my site it provides a float value of "2.27". As a wild guess: lscpu is heavily localized, so depending on your system's locale, it might not have "Model name" in it's output.
   I'ld try ```LC_ALL=C lscpu | grep -i 'Model name' | head -n 1 | egrep -o '[[:digit:]].[[:digit:]]+GHz' | sed 's/GHz//g'```. If this provides you a reasonable Value for your CPU frequency, I'ld recommend to change the system's local to "en_US.UTF-8" (or simply non-localized "C").
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] s-seitz commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
s-seitz commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1230331176

   Ah, I've only seen Xeon's here (which provide their nominal speed in the Model name). So, if there's a frequency reported at your site, it's gathered from libvirt/virsh, the 3rd. and last  input for cloudstack-agent's frequency discovery.
   Maybe, this provides the current, and not the nominal speed?
   Sorry, I couldn't be of much help.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1231279302

   @Hudratronium Is it just about the error in the agent logs or are you seeing any change in the behaviour?
   Current code tries to find the max CPU speed using the following methods, in the same order:
   1. Using lscpu - output of the command - `lscpu | grep -i 'Model name' | head -n 1 | egrep -o '[[:digit:]].[[:digit:]]+GHz' | sed 's/GHz//g'`
   2. Using cpu frequency file - content of file `/sys/devices/system/cpu/cpu0/cpufreq/base_frequency`
   3. From libvirt.
   In your case method1 and 2 are not returning any value so the value from method 3 is used which comes 1803.
   
   In 4.16.1 as well code used to have method 2 and 3. I'm pretty sure you must be getting logs like the following reported earlier,
   `Unable to retrieve the CPU speed from file [/sys/devices/system/cpu/cpu0/cpufreq/base_frequency]. Using the value [1803] provided by the Libvirt.`. It is just an additional way for finding the CPU speed that has been added in 4.17.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Hudratronium commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
Hudratronium commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1231656998

   @shwstppr 
   Okay i guess what has happend....
   
   According to [https://www.kernel.org/doc/html/v5.9/admin-guide/pm/cpufreq.html](url) there is no value `base_frequency`.
   The value for 'base_frequency' is only availeable on systems with Intel CPUs using the 'intel_pstate' driver [https://www.kernel.org/doc/html/v5.9/admin-guide/pm/intel_pstate.html](url).
   
   Meaning that the check 1 as well as 2 won't work with with other CPUs (non Intel or without the '@ XXXX MHz' tag in the 'Model name').
   Updateing the documentation would be nice - as currently only Intel-CPUs are "savely" supported out of the box.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] Hudratronium commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
Hudratronium commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1230323456

   lscpu alone is giving me the whole output which is expected, as well as the 'model name'.
   
   System's locale is locale is `en_GB.UTF-8` . So nothing spcial by any means.... And currently we don't have any requirement for CS to use a special locale Version. If that's **needed** we shall edit the docs soon!
   
   Tried this `LC_ALL=C lscpu | grep -i 'Model name' | head -n 1 | egrep -o '[[:digit:]].[[:digit:]]+GHz' | sed 's/GHz//g'` and the same result.
   Results after every step of the pipes:
   `LC_ALL=C lscpu`  = FULL lscpu result
   `LC_ALL=C lscpu | grep -i 'Model name' ` = Model name:   AMD..... 
   `LC_ALL=C lscpu | grep -i 'Model name' | head -n 1 ` = Model name:  AMD ....
   `LC_ALL=C lscpu | grep -i 'Model name' | head -n 1 | egrep -o '[[:digit:]].[[:digit:]]+GHz' ` = EMPTY with no error
   `LC_ALL=C lscpu | grep -i 'Model name' | head -n 1 | egrep -o '[[:digit:]].[[:digit:]]+GHz' | sed 's/GHz//g'` = EMPTY with no error
   
   The 'Model name' for AMD CPUs doesn't contain any value for speeds nor the "egrep" pattern....
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cloudstack] shwstppr commented on issue #6680: Agent unable to retrieve CPU Speed of host after upgrading to 4.17.0.1

Posted by GitBox <gi...@apache.org>.
shwstppr commented on issue #6680:
URL: https://github.com/apache/cloudstack/issues/6680#issuecomment-1231261344

   @Hudratronium what is the output of the following commands on your server?
   `lscpu | grep -i 'Model name' | head -n 1 | egrep -o '[[:digit:]].[[:digit:]]+GHz' | sed 's/GHz//g'`
   `cat /sys/devices/system/cpu/cpu0/cpufreq/base_frequency`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org