<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-2022-jp" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18928">
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=2 face="MS UI Gothic">Thanks a lot Justin for such a
detailed explanation.</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic"></FONT> </DIV>
<DIV><FONT size=2 face="MS UI Gothic">> If the domain has an XML definition
for it in place, the "Destroy"<BR>> command won't touch it. You can
start the domain again using the<BR>> "Create" function:<BR>>
<BR>> </FONT><A
href="http://libvirt.org/html/libvirt-libvirt.html#virDomainCreate"><FONT size=2
face="MS UI Gothic">http://libvirt.org/html/libvirt-libvirt.html#virDomainCreate</FONT></A><BR><FONT
size=2 face="MS UI Gothic">> <BR>> If you want to get rid of an XML
definition for the domain from a<BR>> server, the command you're looking for
is "undefine":<BR>> <BR>> </FONT><A
href="http://libvirt.org/html/libvirt-libvirt.html#virDomainUndefine"><FONT
size=2
face="MS UI Gothic">http://libvirt.org/html/libvirt-libvirt.html#virDomainUndefine</FONT></A><BR></DIV>
<DIV><FONT size=2 face="MS UI Gothic">I understood now what the destroy function
does. As for "domainUndefine":</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">To quote from the "undefine"
method's documentation:</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic"><EM>Undefine a domain but does not stop it
if it is running</EM></FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">So, If the Domain remains as it
is, what is the significance of removing the XML
Description/Definition?</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">What I want to do, is to remove the Domain
completely from the system, including its associated virtual disks. Is
there any way to do this using the API?</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic"></FONT> </DIV>
<DIV><FONT size=2 face="MS UI Gothic">>> Secondly, Is it possible to boot
a domain on a completely different physical<BR>>> host with the same
Hypervisor configuration?<BR>> <BR>> You can use libvirt for this, but
it's not automatic. As far as I know,<BR>> you'll need to have your
software connect to each of the servers and<BR>> launch the appropriate
virDomainCreate() (and probably other) commands.<BR>> So, it would be up
to your application to make sure that the domain is<BR>> not running on
server A, before you launch it on server B.<BR></FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">I am sorry, but I did not get this quite
completely. Could you please explain this a bit more? Especially the "<EM>it
would be up to your application to make sure that the domain is<BR>not running
on server A, before you launch it on server B</EM>" part. Firstly, how will I
get the domain from server A to server B to launch it there? By migrating it to
server B?</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic"></FONT> </DIV>
<DIV><FONT size=2 face="MS UI Gothic">Please help.</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic"></FONT> </DIV>
<DIV><FONT size=2 face="MS UI Gothic">Thanks and Regards<BR>Sagar
Barve</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">----- Original Message ----- </FONT></DIV>
<DIV>
<DIV><FONT size=2 face="MS UI Gothic">From: "Justin Clift" <</FONT><A
href="mailto:justin@salasaga.org"><FONT size=2
face="MS UI Gothic">justin@salasaga.org</FONT></A><FONT size=2
face="MS UI Gothic">></FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">To: "IKI-サガル バルウ瘢雹ェ" <</FONT><A
href="mailto:sagar.barve@ikic.co.jp"><FONT size=2
face="MS UI Gothic">sagar.barve@ikic.co.jp</FONT></A><FONT size=2
face="MS UI Gothic">></FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">Cc: <</FONT><A
href="mailto:libvir-list@redhat.com"><FONT size=2
face="MS UI Gothic">libvir-list@redhat.com</FONT></A><FONT size=2
face="MS UI Gothic">></FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">Sent: Thursday, June 17, 2010 5:17
PM</FONT></DIV>
<DIV><FONT size=2 face="MS UI Gothic">Subject: Re: [libvirt] 1. Domain Destroy ,
2. Domain boot on a different host and 3. Domain start time</FONT></DIV></DIV>
<DIV><FONT face="MS UI Gothic"><BR><FONT size=2></FONT></FONT></DIV><FONT size=2
face="MS UI Gothic">> On 06/17/2010 05:50 PM, IKI-サガル バルウ瘢雹ェ wrote:<BR>>>
Hello,<BR>>> <BR>>> Firstly, I have some confusion about the libvirt
API "virDomainDestroy"<BR>>> method. here is the link to
API:<BR>>> </FONT><A
href="http://libvirt.org/html/libvirt-libvirt.html#virDomainDestroy"><FONT
size=2
face="MS UI Gothic">http://libvirt.org/html/libvirt-libvirt.html#virDomainDestroy</FONT></A><BR><FONT
size=2 face="MS UI Gothic">> <BR>> "Destroy" here can be a bit
confusing. It doesn't really touch or<BR>> remove the disk data.
"Destroy" in this case means to destroy just the<BR>> running instance of the
domain. i.e. stop running it, free up the<BR>> memory that was
allocated to it, and free up any devices (network<BR>> resource, etc) that
had been assigned to it.<BR>> <BR>> If the domain has an XML definition
for it in place, the "Destroy"<BR>> command won't touch it. You can
start the domain again using the<BR>> "Create" function:<BR>>
<BR>> </FONT><A
href="http://libvirt.org/html/libvirt-libvirt.html#virDomainCreate"><FONT size=2
face="MS UI Gothic">http://libvirt.org/html/libvirt-libvirt.html#virDomainCreate</FONT></A><BR><FONT
size=2 face="MS UI Gothic">> <BR>> If you want to get rid of an XML
definition for the domain from a<BR>> server, the command you're looking for
is "undefine":<BR>> <BR>> </FONT><A
href="http://libvirt.org/html/libvirt-libvirt.html#virDomainUndefine"><FONT
size=2
face="MS UI Gothic">http://libvirt.org/html/libvirt-libvirt.html#virDomainUndefine</FONT></A><BR><FONT
size=2 face="MS UI Gothic">> <BR>> <BR>>> Secondly, Is it possible
to boot a domain on a completely different physical<BR>>> host with the
same Hypervisor configuration?<BR>>> For. E.g: if I have a domain on a
host 192.168.101.1 running Xen with a<BR>>> Domain "test" in shutdown
state. If I have to start/boot the domain "test"<BR>>> on a different
physical host, running Xen say 192.168.101.2, is it possible<BR>>> using
libvirt API? If not, then is there any other method to do it?<BR>> <BR>>
You can use libvirt for this, but it's not automatic. As far as I
know,<BR>> you'll need to have your software connect to each of the servers
and<BR>> launch the appropriate virDomainCreate() (and probably other)
commands.<BR>> So, it would be up to your application to make sure that
the domain is<BR>> not running on server A, before you launch it on server
B.<BR>> <BR>> <BR>>> Thirdly, Is there a method to get the total
running time of a domain? I<BR>>> mean, the amount of time since the
domain had been booted. Currently, I can<BR>>> fetch the CPU time. But, is
this the exact amount of time the domain is ON?<BR>>> i.e. If the domain
is in a "IDLE" state, the CPU time does not increase. But<BR>>> what I
want is the amount of time the domain was ON(including the idle<BR>>>
time). So, If I can get the start time of the domain, I can calculate
the<BR>>> duration.<BR>> <BR>> Sorry, I personally can't help with
this one. I haven't had to look at<BR>> this stuff yet.<BR>>
<BR>> Hope the above stuff helps though. :)<BR>> <BR>> Regards and best
wishes,<BR>> <BR>> Justin Clift<BR>> <BR>> -- <BR>>
Salasaga - Open Source eLearning
IDE<BR>>
</FONT><A href="http://www.salasaga.org"><FONT size=2
face="MS UI Gothic">http://www.salasaga.org</FONT></A></BODY></HTML>