Hi,
I'm working on a VirtualBox driver for Cloudify: (virtualbox-cloudify-driver in github)
Cloudify is a tool to deploy your application on any IaaS.
Because I don't have an internet connection sometimes, I decided to develop this driver to simulate a cloud on my laptop.
It works fine, I'm using the WebService to do that, with the vboxjws.jar.
In Cloudify 2.5, you can now attach a "volume" to the VM. Ex: in EC2, you can attach an EBS to the VM, so when the VM crash, it creates a new VM and attach the EBS to it.
I started to implement this feature in my driver, but it's not working:
I saw that "storageattach" can attach (or detach) volumes to a running VM if it uses a SATA controller, but the WebService API doesn't allow me to do that (exception about "the state of the VM is running")
Is it a "feature request" ? How can I ask that ? Can I change it "quickly" by contributing to the vboxjw.jar (so you can merge my contribution latter) ? If so, do you have any hints?
Thanks by advance.
Regards.
Be able to do "storageattach" in WS
-
- Site Moderator
- Posts: 5229
- Joined: 13. Jan 2012, 11:14
- Primary OS: Debian other
- VBox Version: OSE Debian
- Guest OSses: Debian, Win 2k8, Win 7
- Contact:
Re: Be able to do "storageattach" in WS
Are you positive the VM still has free SATA port available before attempting the attach?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Manage your VirtualBox infrastructure the free way!
Re: Be able to do "storageattach" in WS
Yes I'm sure (I already had this error before, now I put the maximum number of port: 30)
My error log is:
As you can see, the WebService doesn't allow me to "hot plug" the disk.
In the WebService output (vboxwebsrv) I have the same error:
My error log is:
Code: Select all
2013-04-15 20:18:28,804 ESM SEVERE [org.openspaces.grid.gsm.machines.plugins.NonBlockingElasticMachineProvisioningAdapter] - Unexpected exception:VirtualBox error: The machine is not mutable (state is Running) (0x80BB0002); Caused by: org.virtualbox_4_2.VBoxException: VirtualBox error: The machine is not mutable (state is Running) (0x80BB0002)
at org.virtualbox_4_2.IMachine.attachDevice(IMachine.java:2818)
In the WebService output (vboxwebsrv) I have the same error:
Code: Select all
32:39:36.660812 SQW01 API return code: 0x80BB0002 (VBOX_E_INVALID_VM_STATE)
32:39:36.660865 SQW01 COM error info result code: 0x80BB0002
32:39:36.660877 SQW01 COM error info text: The machine is not mutable (state is Running)
-
- Site Moderator
- Posts: 5229
- Joined: 13. Jan 2012, 11:14
- Primary OS: Debian other
- VBox Version: OSE Debian
- Guest OSses: Debian, Win 2k8, Win 7
- Contact:
Re: Be able to do "storageattach" in WS
Do you actual get a mutable object before attempting this change?
Relevant part of your code would help here.
Relevant part of your code would help here.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Manage your VirtualBox infrastructure the free way!
Re: Be able to do "storageattach" in WS
Thank you for your help!
Indeed, I forgot to use a mutable object (but I use mutable object somewhere lese in the code... really don't know this time I didn't).
So I changed:
By:
Indeed, I forgot to use a mutable object (but I use mutable object somewhere lese in the code... really don't know this time I didn't).
So I changed:
Code: Select all
IMachine m = virtualBoxManager.getVBox().findMachine(machineGuid);
m.attachDevice(defaultController, controllerPort, 0, DeviceType.HardDisk, medium);
Code: Select all
IMachine m = virtualBoxManager.getVBox().findMachine(machineGuid);
ISession session = virtualBoxManager.openMachineSession(m);
m = session.getMachine();
try {
m.attachDevice(defaultController, controllerPort, 0, DeviceType.HardDisk, medium);
m.saveSettings();
} finally{
this.virtualBoxManager.closeMachineSession(session);
}
-
- Posts: 1
- Joined: 21. Jun 2013, 08:42
Re: Be able to do "storageattach" in WS
Can u tell me which programming laguage it is?
-
- Site Moderator
- Posts: 39134
- Joined: 4. Sep 2008, 17:09
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Mostly XP
Re: Be able to do "storageattach" in WS
.jar == Java.