[libvirt-users] pre/post vm start commands

Daniel P. Berrange berrange at redhat.com
Thu Feb 11 11:57:35 UTC 2010

On Thu, Feb 11, 2010 at 11:54:45AM +0000, Daniel P. Berrange wrote:
> On Wed, Feb 10, 2010 at 06:26:02PM +0100, Soeren Grunewald wrote:
> > Hi there,
> > 
> > for development i use a windows vm. which is installed into a disk 
> > image. because the compiler generates a lot of temporary files into the 
> > user tempdir (C:\\Documents And Users\\User\\Local Settings\\Temp) the 
> > vm becomes quite slow after a couple of weeks and i register a lot 
> > activity on the disk.
> > so i moved the temp directory to a ram disk and no more problems.
> > 
> > but because the ram disk is not formated on startup i need to do this by 
> > hand. so i disabled autostart for the vm and do the following:
> > 
> > $ sudo mkfs.ntfs -q -L TEMP -I /dev/ram0
> > $ sudo virsh start windows
> > 
> > so the question is, does libvirt provide some kind of pre startup script 
> > which is will be executed before the libvirtd does the autostart for the vm.
> No, there's no explicit hook for that. Given your description of the
> setup you have, I'm wondering why you don't just format the NTFS 
> partition inside your windows guest as the first step of your build
> process, or upon Windows startup. Using Windows' native NTFS formatting
> tool rather than the linux mkfs.ntfs reverse engineered one sounds safer
> to me anyway

Oh, or the other option is to just create yourself an initscript in
the host which dos the formatting, and configure it to start before
the libvirtd initscript

|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

More information about the libvirt-users mailing list