On 06/17/2010 05:50 PM, IKI-サガル バルウェ wrote:
Hello,
Firstly, I have some confusion about the libvirt API "virDomainDestroy"
method. here is the link to API:
http://libvirt.org/html/libvirt-libvirt.html#virDomainDestroy
"Destroy" here can be a bit confusing. It doesn't really touch or
remove the disk data. "Destroy" in this case means to destroy just the
running instance of the domain. i.e. stop running it, free up the
memory that was allocated to it, and free up any devices (network
resource, etc) that had been assigned to it.
If the domain has an XML definition for it in place, the "Destroy"
command won't touch it. You can start the domain again using the
"Create" function:
http://libvirt.org/html/libvirt-libvirt.html#virDomainCreate
If you want to get rid of an XML definition for the domain from a
server, the command you're looking for is "undefine":
http://libvirt.org/html/libvirt-libvirt.html#virDomainUndefine
Secondly, Is it possible to boot a domain on a completely different
physical
host with the same Hypervisor configuration?
For. E.g: if I have a domain on a host 192.168.101.1 running Xen with a
Domain "test" in shutdown state. If I have to start/boot the domain
"test"
on a different physical host, running Xen say 192.168.101.2, is it possible
using libvirt API? If not, then is there any other method to do it?
You can use libvirt for this, but it's not automatic. As far as I know,
you'll need to have your software connect to each of the servers and
launch the appropriate virDomainCreate() (and probably other) commands.
So, it would be up to your application to make sure that the domain is
not running on server A, before you launch it on server B.
Thirdly, Is there a method to get the total running time of a domain?
I
mean, the amount of time since the domain had been booted. Currently, I can
fetch the CPU time. But, is this the exact amount of time the domain is ON?
i.e. If the domain is in a "IDLE" state, the CPU time does not increase. But
what I want is the amount of time the domain was ON(including the idle
time). So, If I can get the start time of the domain, I can calculate the
duration.
Sorry, I personally can't help with this one. I haven't had to look at
this stuff yet.
Hope the above stuff helps though. :)
Regards and best wishes,
Justin Clift
--
Salasaga - Open Source eLearning IDE
http://www.salasaga.org