Release, remove and create new harddisk with VBox webservice

Discussions related to using VirtualBox on Windows hosts.
Post Reply
BobKubista
Posts: 5
Joined: 27. Jul 2012, 13:47

Release, remove and create new harddisk with VBox webservice

Post by BobKubista »

Hello,

I have a problem with data going corrupt om a VM. This is a VM running linux. The procedure I want to do via the (java) webservice, due to circumstances, is that I want to release the hard disk (haven't found this yet), delete the .vdi and then create a new harddisk(already know how).

The question is how do I release and delete the .vdi?

Thanks in advance.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Release, remove and create new harddisk with VBox webser

Post by noteirak »

Release the disk : IMachine::detachDevice()
Delete the .vdi : IMedium::deleteStorage() obtained from IMachine::getMedium()
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
BobKubista
Posts: 5
Joined: 27. Jul 2012, 13:47

Re: Release, remove and create new harddisk with VBox webser

Post by BobKubista »

thanks. Exaclty what I was looking for.
Post Reply