Page 1 of 1

Release, remove and create new harddisk with VBox webservice

Posted: 14. Dec 2012, 13:41
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.

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

Posted: 14. Dec 2012, 14:16
by noteirak
Release the disk : IMachine::detachDevice()
Delete the .vdi : IMedium::deleteStorage() obtained from IMachine::getMedium()

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

Posted: 14. Dec 2012, 15:47
by BobKubista
thanks. Exaclty what I was looking for.