Hi Eric,
 
Thanks for your valuable time and comments.
 
>> Are you sure cpuacct was mounted prior to libvirtd starting?
Yes, we are mounting cpuacct before starting the libvirtd daemon.
 
>> Libvirt won't mount cgroups;
Yes, Agree.
>>it only uses what was mounted at the time it was started.
But we are mounting it well before it is started.
 
We are facing the issue only while executing the "cpu-stats <domain name>" command. 
 
One more observation is that : While starting the domain, we are observing the below error.
 
"2013-08-22 12:45:44.326+0000: 17554: warning : qemuSetupCgroupForVcpu:953 : Unable to get vcpus' pids."
 
This may be the root cause of  virsh cpu-stats not working. ( seems to be because of CPU pinning issue )
 
Because of this the VCPU directories are not created for the corresponding domain in "/dev/cgroup_<controller>/machine/<domain>.libvirt-qemu/" and hence the "cpu-stats" command is not working.
Please let us know your view on this.

We  have collected the debug logs, please find the attachment for the same..
 
Thanks and Regards,
Shree Duth Awasthi.
 
On Wed, Aug 21, 2013 at 9:35 PM, Eric Blake <eblake@redhat.com> wrote:
On 08/21/2013 03:55 AM, SHREE DUTH AWASTHI wrote:

[putting your name in ALL CAPS looks like you are shouting]

>>
>> Hi All,
>>
>> Can you please guide us in solving this issue.
>>
>> Version used : libvirt-1.0.6
>> # rpm -qa | egrep  "libvirt|qemu"
>> qemu-kvm-0.14.1-1_WR4.3.x86_64_XXX.x86_64
>> libvirt-1.0.6-1_WR4.3.x86_64_XXX.2.x86_64
>>
>> Problem :
>>
>> # virsh cpu-stats CLA-0
>> error: Failed to retrieve CPU statistics for domain 'CLA-0'
>> *error: internal error error accessing cgroup cpuacct for vcpu*

Are you sure cpuacct was mounted prior to libvirtd starting?

>>
>> Related info :
>>
>> # cat /proc/cgroups
>> #subsys_name    hierarchy       num_cgroups     enabled
>> cpuset                      3                     4                  1
>> ns                             0                    1                  1
>> cpu                           1                    6                  1
>> cpuacct                     7                    3                  1

The fact that it has a rather high hierarchy number (7) makes me think
you mounted it after the fact.


>>
>> We have also found that there is no "*cgroup*" directory created under *
>> "/sys/fs/".* We have tried mounting the same manually using the below
>> commands but we were not successful.

Cgroups are typically mounted by systemd in newer systems, but the fact
that you are trying to mount manually says that you aren't using
systemd.  Libvirt won't mount cgroups; it only uses what was mounted at
the time it was started.

--
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org