I've a 2.6GHz dual core machine with 8G memory. I want to set CPU Speed (Change to Hz i.e. 1GHz or 500MHz processors etc) for VM. I could not found it in xm and virsh commands help. Is there any way to change Hz in Xen?
It should work from XEN 4.x onwards with recent CPUs (e.g. AMD-Opteron-Quad-Core or newer).
For details look at the XEN-Wiki about power-management.
Naturally you can only change the Dom0 CPUs - there are no real ones in DomUs.
You can't really do that in the way you would expect. i.e. you can't just say that that VM has a 1GHz processor.
What you can do though is change the number of CPU cores assigned to the virtual machine, and the scheduling weight and cap.
You mention the use of virsh which means libvirt. I suggest you first start looking at the credit scheduler docs which details those options and then by using the schedinfo & setvcpus parameters to virsh you should be able to tweak things as you require.
EDIT: If you set the cap to around 36 it's approximately 1GHz or 35% of 1 core assuming that it's always going to be running at full speed.