[Fedora-xen] freeing up memory back to Domain-0

Justin Conover justin.conover at gmail.com
Tue Aug 21 11:58:08 UTC 2007


On 8/21/07, Richard W.M. Jones <rjones at redhat.com> wrote:
>
> Justin Conover wrote:
>
> [These are a couple of frequently asked questions ... do we have an FAQ?]
>
> > How can you free up memory when you shut a guest down?  Give back to
> > Domain-0 so you can start another one up?
>
> Domain-0 doesn't recover the memory when a domain shuts down.  The
> assumption (within Xen) is that another domain will be starting up
> shortly, so there is no point wasting time returning the memory to
> Domain-0.
>
> However the memory hasn't just gone away, as your question implies.  The
> hypervisor is still managing that free memory, and will give it to the
> next guest which starts up.
>
> If you really want to give the free memory back to Domain-0, then I
> think you can do it by:
>
>    virsh setmem Domain-0 <kb>
>
> where <kb> is the total number of kilobytes that you want Domain-0 to
> have (ie. current size + size of freed guest -- you have to calculate
> this for yourself).
>
> > Also, were are the profiles for xen stored?  For example I create all of
> > them under /vm/xen/blah if I decide to delete blah1 and create a new one
> > named blah1 it says it is already there, even though I removed it.
>
> Since Xen 3.0.3 or 3.0.4, I forget exactly which, Xen manages the
> profiles in its own private place.  So there are no configuration files.
>   I agree that this is very annoying, but that's the way Xen forces us
> to do it.
>
> To view or edit a configuration file, you now have to do:
>
>    virsh dumpxml domain > domain.xml
>    edit domain.xml
>    virsh define domain.xml
>
> ('virsh define' only works if the domain has been shutdown, so if it is
> still running then shut it down first using 'virsh shutdown').
>
> If you want to make a change to a running domain, there are some changes
> which you are allowed to do, basically adding and removing block and
> network devices, and adding and removing memory.  The commands to use are:
>
>    virsh attach-device
>    virsh attach-disk
>    virsh attach-interface
>    virsh detach-device
>    virsh detach-disk
>    virsh detach-interface
>    virsh setmem
>    virsh setmaxmem
>
> (Just do 'virsh help command' to get help on each of those commands).
>
> Rich.
>
> --
> Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
> Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
> Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
> England and Wales under Company Registration No. 03798903
>
>

Very nice, thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-xen/attachments/20070821/0a665989/attachment.htm>


More information about the Fedora-xen mailing list