[libvirt-users] pre/post vm start commands

Soeren Grunewald soeren.grunewald at avionic-design.de
Fri Feb 12 19:19:21 UTC 2010


ok, thx
i'm afraid thats truly the best way to do it...for me
--
Thx again
Soeren

On 11.02.2010 12:57, Daniel P. Berrange wrote:
> 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
>
> Daniel




More information about the libvirt-users mailing list