Dexmorgan Posted November 28, 2021 Share Posted November 28, 2021 Hi Guys, I have a rather unique situation. I have a windows VM that runs an app that creates huge amount of temporary data. This data is not useless when the VM is shutdown and data is not reusable. So instead of creating this vdisk and allocating a big space in my SSD, I would like to create this vdisk on the fly as I start my VM. When I shutdown, the vdisk can be automatically remove to space my SSD space for other purpose. Is this possible to do? Apology is this has been asked before. I couldn't find anything related. TIA, Dex Quote Link to comment
SimonF Posted November 28, 2021 Share Posted November 28, 2021 36 minutes ago, Dexmorgan said: Hi Guys, I have a rather unique situation. I have a windows VM that runs an app that creates huge amount of temporary data. This data is not useless when the VM is shutdown and data is not reusable. So instead of creating this vdisk and allocating a big space in my SSD, I would like to create this vdisk on the fly as I start my VM. When I shutdown, the vdisk can be automatically remove to space my SSD space for other purpose. Is this possible to do? Apology is this has been asked before. I couldn't find anything related. TIA, Dex I don't think there is a way to do via the GUI, QEMU does have a hooks system so you could build a script to add and remove the disk during start up and shutdown. On 6.9.2 and below there is a single file called QEMU and in 6.10 it is possible to have multiple scripts in a qemu.d directory, but you may need to create the directory. Here is the script I use for my USB_Manager plugin. The files are persistant so no special processing is needed to restore on boot. Here is more info on hooks. https://libvirt.org/hooks.html Quote Link to comment
Dexmorgan Posted November 28, 2021 Author Share Posted November 28, 2021 Thanks for your prompt reply. Looks promising, will have a close look Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.