AndreaÂ--
You received this message because you are subscribed to the Google Groups "jclouds-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds-dev/-/jJ8t4mFo4PAJ.
To post to this group, send email to jclou...@googlegroups.com.
To unsubscribe from this group, send email to jclouds-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds-dev?hl=en.
Thanks for the support,
Andrea
We hope that this effort on jclouds can give a boost even to Whirr.
Thanks for the info about what works vs doesn't, and bringing
visibility to what you are doing.
comments inline.
On Wed, Dec 14, 2011 at 6:55 AM, Andrea <andrea...@gmail.com> wrote:
> Since a bunch of months me, Adrian and Mattias are working hard to release
> the jclouds virtualbox api.
>
> I've finally discovered that vbox CLI used vbox API to offer all the
> operations - vboxmanage CLI - and probably this will speed up our
> implementation:
particularly where this is modeled in a way that we can switch to API later.
>
> In particular:
>
> VirtualBoxManager.getSessionObject().getConsole().getGuest().executeProcess(execName,
> flags, arguments, environment, userName, password, timeoutMS, pid)
> will be useful to export ip address instead of using a Statement like the
> one we have at the moment based on vboxmanage guestproperty enumerate
> "$VMNAME" --patterns "/VirtualBox/GuestInfo/Net/0/V4/IP" | awk '{ print $4
> }' | cut -c 1-14.
> and to remove the udev crap from the vm, for debian-based os.
The above seems like better modeled as an API call, as metadata such
as IP address info surely must be in a domain object somewhere, right?
In general, I get the idea, though: progress before perfection.
I might consider making a version of RunScriptOnNode that works with
VBoxManager, too.
>
> Unfortunately it will not help us using:
>
> VirtualBoxManager.getSessionObject().getConsole().getGuest().updateGuestAdditions(source,
> flags)
> cause according to the vbox devs this feature is buggy.
So, what's the alternative here? running a script?
I'm Andrea but it's ok! :P
> Thanks for the info about what works vs doesn't, and bringing
> visibility to what you are doing.
>
> comments inline.
>
> On Wed, Dec 14, 2011 at 6:55 AM, Andrea <andrea...@gmail.com> wrote:
>> Since a bunch of months me, Adrian and Mattias are working hard to release
>> the jclouds virtualbox api.
>>
>> I've finally discovered that vbox CLI used vbox API to offer all the
>> operations - vboxmanage CLI - and probably this will speed up our
>> implementation:
> particularly where this is modeled in a way that we can switch to API later.
I didn't get this point, sorry. can you rephrase please.
>>
>> In particular:
>>
>> VirtualBoxManager.getSessionObject().getConsole().getGuest().executeProcess(execName,
>> flags, arguments, environment, userName, password, timeoutMS, pid)
>> will be useful to export ip address instead of using a Statement like the
>> one we have at the moment based on vboxmanage guestproperty enumerate
>> "$VMNAME" --patterns "/VirtualBox/GuestInfo/Net/0/V4/IP" | awk '{ print $4
>> }' | cut -c 1-14.
>> and to remove the udev crap from the vm, for debian-based os.
> The above seems like better modeled as an API call, as metadata such
> as IP address info surely must be in a domain object somewhere, right?
> Â In general, I get the idea, though: progress before perfection.
You're probably right about the domain object but consider also that
those calls work only if guest additions are installed so maybe they
don't model the domain object.
> I might consider making a version of RunScriptOnNode that works with
> VBoxManager, too.
Probably it is not strictly needed.
>
>>
>> Unfortunately it will not help us using:
>>
>> VirtualBoxManager.getSessionObject().getConsole().getGuest().updateGuestAdditions(source,
>> flags)
>> cause according to the vbox devs this feature is buggy.
> So, what's the alternative here? Â running a script?
Yeah in this case a script seems to me the only possibility now. I
submitted a pull request for that a couple of hours ago.
Inline andrea :)
On Dec 14, 2011 9:19 AM, "Andrea Turli" <andrea...@gmail.com> wrote:
>
> On Wed, Dec 14, 2011 at 5:05 PM, Adrian Cole <adrian...@gmail.com> wrote:
> > Thanks for the update, Andrei. Â and kudos to you and Mattias for
> > carrying this forward.
>
> I'm Andrea but it's ok! :P
>
> > Thanks for the info about what works vs doesn't, and bringing
> > visibility to what you are doing.
> >
> > comments inline.
> >
> > On Wed, Dec 14, 2011 at 6:55 AM, Andrea <andrea...@gmail.com> wrote:
> >> Since a bunch of months me, Adrian and Mattias are working hard to release
> >> the jclouds virtualbox api.
> >>
> >> I've finally discovered that vbox CLI used vbox API to offer all the
> >> operations - vboxmanage CLI - and probably this will speed up our
> >> implementation:
> > particularly where this is modeled in a way that we can switch to API later.
When you can run vboxmanage vs api and achieve the same result, it seems like a strategy pattern where an interface with @ImplementedBy(FavoriteImpl.class) could help?
>
> I didn't get this point, sorry. can you rephrase please.
>
> >>
> >> In particular:
> >>
> >> VirtualBoxManager.getSessionObject().getConsole().getGuest().executeProcess(execName,
> >> flags, arguments, environment, userName, password, timeoutMS, pid)
> >> will be useful to export ip address instead of using a Statement like the
> >> one we have at the moment based on vboxmanage guestproperty enumerate
> >> "$VMNAME" --patterns "/VirtualBox/GuestInfo/Net/0/V4/IP" | awk '{ print $4
> >> }' | cut -c 1-14.
> >> and to remove the udev crap from the vm, for debian-based os.
> > The above seems like better modeled as an API call, as metadata such
> > as IP address info surely must be in a domain object somewhere, right?
> > Â In general, I get the idea, though: progress before perfection.
>
> You're probably right about the domain object but consider also that
> those calls work only if guest additions are installed so maybe they
> don't model the domain object.
Sure makes sense
>
> > I might consider making a version of RunScriptOnNode that works with
> > VBoxManager, too.
> Probably it is not strictly needed.
Your call, just a random thought :)
> >
> >>
> >> Unfortunately it will not help us using:
> >>
> >> VirtualBoxManager.getSessionObject().getConsole().getGuest().updateGuestAdditions(source,
> >> flags)
> >> cause according to the vbox devs this feature is buggy.
> > So, what's the alternative here? Â running a script?
>
> Yeah in this case a script seems to me the only possibility now. I
> submitted a pull request for that a couple of hours ago.
Will check that out. Thx!
If I understand your explanation correctly,
UnregisterMachineIfExistsAndDeleteItsMedia will only work if there are
no linked clones. If this is "correct" according to virtualbox I don't
think it's something that needs to be fixed immediately, especially if
the "cleanup" one needs to do - delete all linked clones - is possible
using some kind of "delete loop" in client code.
In that case, I think it would be OK to document the behaviour and
point to a code sample of how to find all linked clones and delete
them if necessary.
ap
If I understand your explanation correctly, UnregisterMachineIfExistsAndDeleteItsMedia will only work if there are no linked clones. If this is "correct" according to virtualbox I don't think it's something that needs to be fixed immediately, especially if the "cleanup" one needs to do - delete all linked clones - is possible using some kind of "delete loop" in client code.If either some other VM refers to some snapshots (linked clone), or you
have some leftover diff image...
you need to delete all linked clones first and then the original machine.
In that case, I think it would be OK to document the behaviour and point to a code sample of how to find all linked clones and delete them if necessary.
ap
--
You received this message because you are subscribed to the Google Groups "jclouds-dev" group.
To post to this group, send email to jclou...@googlegroups.com.
To unsubscribe from this group, send email to jclouds-dev+unsubscribe@googlegroups.com.
Hi, Andrea.
Good stuff and thanks for pinging jclouds-dev + Thoughts inline.
On Dec 31, 2011 2:43 AM, "Andrea Turli" <andrea...@gmail.com> wrote:
>
> I'm trying to implement the functionality to find all linked clones and delete them if necessary.
>
> The idea like in the pipe shell is to compose different small function to solve a bigger problem.
Warning.. Guava advise to follow :)
> Starting from these 3 operations:
>
> List<IMachine>Â findClonesOfAMachine(VmSpec)
Iterable<IMachine> clones = Iterables.filter(allMachines, IMachinePredicates.ofSpec(vmspec));
>
> VmSpec IMachineToVmSpec(IMachine)
Iterable<VmSpec> specs = Iterables.transform(clones, IMachines.toVmSpec());
>
> UnregisterMachineIfExistsAndDeleteItsMedia(VmSpec)
Iterable<Boolean> deletedOrDidntExist = Iterables.transform(specs, VmSpecs.unregisterAndDeleteMediaIfExists(vboxmgr));
Note this could be ... Functions.compose(unregisterIfExists,deleteMedia) which is easier to test.
>
> we can have something like:
>
> findClonesOfAMachine | IMachineToVmSpec |Â UnregisterMachineIfExistsAndDeleteItsMedia
>
> to delete all the linked clones of a particular machine.
>
> There are some edge cases in this approach, more specifically, this approach is not idempotent, in fact the order of the machines deletion is important: first the linked clones than the "master".
You can add an ordering step before delete.
>
> Is it reasonable? What do you think? Any suggestions?
Yep. Very sensible.
Sounds like you want to emulate a shell pipeline. Here's some hints:
Grep = Iterables.filter
Sed = Iterables.transform
Sort = Ordering...
Good job on this! Keep us posted and in the loop.
-A
>
> Thanks,
> Andrea
>
>
> On Thu, Dec 22, 2011 at 3:10 PM, Andrea Turli <andrea...@gmail.com> wrote:
>>
>> Thx Andrew.
>>
>> On Thu, Dec 22, 2011 at 3:05 PM, Andrew Phillips <aphi...@qrmedia.com> wrote:
>>>>
>>>> If either some other VM refers to some snapshots (linked clone), or you
>>>> have some leftover diff image...
>>>> you need to delete all linked clones first and then the original machine.
>>>
>>>
>>> If I understand your explanation correctly, UnregisterMachineIfExistsAndDeleteItsMedia will only work if there are no linked clones. If this is "correct" according to virtualbox I don't think it's something that needs to be fixed immediately, especially if the "cleanup" one needs to do - delete all linked clones - is possible using some kind of "delete loop" in client code.
>>>
>> This seems to be the expected behaviour according to vbox community.
>>
>>> In that case, I think it would be OK to document the behaviour and point to a code sample of how to find all linked clones and delete them if necessary.
>>
>>
>> Actually this is a very good idea: we will add an helper to delete all the linked clones starting from a machine.
>>
>> Andrea
>>>
>>>
>>>
>>> ap
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "jclouds-dev" group.
>>> To post to this group, send email to jclou...@googlegroups.com.
>>> To unsubscribe from this group, send email to jclouds-dev...@googlegroups.com.
>>> For more options, visit this group at http://groups.google.com/group/jclouds-dev?hl=en.
>>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups "jclouds-dev" group.
> To post to this group, send email to jclou...@googlegroups.com.
> To unsubscribe from this group, send email to jclouds-dev...@googlegroups.com.
Hi, Andrea.
Good stuff and thanks for pinging jclouds-dev + Thoughts inline.
Warning.. Guava advise to follow :)
On Dec 31, 2011 2:43 AM, "Andrea Turli" <andrea...@gmail.com> wrote:
>
> I'm trying to implement the functionality to find all linked clones and delete them if necessary.
>
> The idea like in the pipe shell is to compose different small function to solve a bigger problem.
> Starting from these 3 operations:
>
> List<IMachine>Â findClonesOfAMachine(VmSpec)Iterable<IMachine> clones = Iterables.filter(allMachines, IMachinePredicates.ofSpec(vmspec));
>
> VmSpec IMachineToVmSpec(IMachine)Iterable<VmSpec> specs = Iterables.transform(clones, IMachines.toVmSpec());
>
> UnregisterMachineIfExistsAndDeleteItsMedia(VmSpec)
Iterable<Boolean> deletedOrDidntExist = Iterables.transform(specs, VmSpecs.unregisterAndDeleteMediaIfExists(vboxmgr));Note this could be ... Functions.compose(unregisterIfExists,deleteMedia) which is easier to test.
>You can add an ordering step before delete.
> we can have something like:
>
> findClonesOfAMachine | IMachineToVmSpec |Â UnregisterMachineIfExistsAndDeleteItsMedia
>
> to delete all the linked clones of a particular machine.
>
> There are some edge cases in this approach, more specifically, this approach is not idempotent, in fact the order of the machines deletion is important: first the linked clones than the "master".
Back at ya
On Jan 3, 2012 3:45 AM, "Andrea Turli" <andrea...@gmail.com> wrote:
>
> Thanks Adrian for the feedback. Inline my comments:
>
> On Sat, Dec 31, 2011 at 5:46 PM, Adrian Cole <adrian...@gmail.com> wrote:
>>
>> Hi, Andrea.
>>
>> Good stuff and thanks for pinging jclouds-dev + Thoughts inline.
>>
>>
>> On Dec 31, 2011 2:43 AM, "Andrea Turli" <andrea...@gmail.com> wrote:
>> >
>> > I'm trying to implement the functionality to find all linked clones and delete them if necessary.
>> >
>> > The idea like in the pipe shell is to compose different small function to solve a bigger problem.
>> Warning.. Guava advise to follow :)
>>
>> > Starting from these 3 operations:
>> >
>> > List<IMachine>Â findClonesOfAMachine(VmSpec)
>>
>> Iterable<IMachine> clones = Iterables.filter(allMachines, IMachinePredicates.ofSpec(vmspec));
>
> This is a good proposal but at the moment I'm not sure we can have the list of all the machines to be filtered using the vbox api.Â
Interesting. Care to elaborate? what can be listed? As ComputeService needs to impl listNodes, we need to figure out some strategy for this.
>>
>> >
>> > VmSpec IMachineToVmSpec(IMachine)
>>
>> Iterable<VmSpec> specs = Iterables.transform(clones, IMachines.toVmSpec());
>
> This is implemented and already accepted in jclouds/jclouds.Â
Good job on that.
>>
>> >
>> > UnregisterMachineIfExistsAndDeleteItsMedia(VmSpec)
>> Iterable<Boolean> deletedOrDidntExist = Iterables.transform(specs, VmSpecs.unregisterAndDeleteMediaIfExists(vboxmgr));
>>
>> Note this could be ... Functions.compose(unregisterIfExists,deleteMedia) which is easier to test.
>
> I completely agree with this. Good idea.
Cool
>>
>> >
>> > we can have something like:
>> >
>> > findClonesOfAMachine | IMachineToVmSpec |Â UnregisterMachineIfExistsAndDeleteItsMedia
>> >
>> > to delete all the linked clones of a particular machine.
>> >
>> > There are some edge cases in this approach, more specifically, this approach is not idempotent, in fact the order of the machines deletion is important: first the linked clones than the "master".
>> You can add an ordering step before delete.
>
> Â
> If I have correctly understood you are suggesting to have also a check inside "UnregisterMachineIfExistsAndDeleteItsMedia(machine)" to recursively find & order all the clones of the given machine.Â
>
> In fact sometimes you cannot delete a 'master' machine, if it has been linked cloned, because its hd is shared with other clones. In that case it is reasonable to delete all the machines "attached to that master" to finally delete the master.
>
> Maybe we need to improve VmSpec domain class with the list of linked clones. wdyt?
By ordering I mean a separate sort step, which orders children first.
VmSpec is probably best used for specs to launch and a name like Vm is better for runtime data like current children, imho. Wdyt?
Back at ya
Interesting. Care to elaborate? what can be listed? As ComputeService needs to impl listNodes, we need to figure out some strategy for this.
On Jan 3, 2012 3:45 AM, "Andrea Turli" <andrea...@gmail.com> wrote:
>
> Thanks Adrian for the feedback. Inline my comments:
>
> On Sat, Dec 31, 2011 at 5:46 PM, Adrian Cole <adrian...@gmail.com> wrote:
>>
>> Hi, Andrea.
>>
>> Good stuff and thanks for pinging jclouds-dev + Thoughts inline.
>>
>>
>> On Dec 31, 2011 2:43 AM, "Andrea Turli" <andrea...@gmail.com> wrote:
>> >
>> > I'm trying to implement the functionality to find all linked clones and delete them if necessary.
>> >
>> > The idea like in the pipe shell is to compose different small function to solve a bigger problem.
>> Warning.. Guava advise to follow :)
>>
>> > Starting from these 3 operations:
>> >
>> > List<IMachine>Â findClonesOfAMachine(VmSpec)
>>
>> Iterable<IMachine> clones = Iterables.filter(allMachines, IMachinePredicates.ofSpec(vmspec));
>
> This is a good proposal but at the moment I'm not sure we can have the list of all the machines to be filtered using the vbox api.Â
>>Good job on that.
>> >
>> > VmSpec IMachineToVmSpec(IMachine)
>>
>> Iterable<VmSpec> specs = Iterables.transform(clones, IMachines.toVmSpec());
>
> This is implemented and already accepted in jclouds/jclouds.ÂCool
>>
>> >
>> > UnregisterMachineIfExistsAndDeleteItsMedia(VmSpec)
>> Iterable<Boolean> deletedOrDidntExist = Iterables.transform(specs, VmSpecs.unregisterAndDeleteMediaIfExists(vboxmgr));
>>
>> Note this could be ... Functions.compose(unregisterIfExists,deleteMedia) which is easier to test.
>
> I completely agree with this. Good idea.
By ordering I mean a separate sort step, which orders children first.
>>
>> >
>> > we can have something like:
>> >
>> > findClonesOfAMachine | IMachineToVmSpec |Â UnregisterMachineIfExistsAndDeleteItsMedia
>> >
>> > to delete all the linked clones of a particular machine.
>> >
>> > There are some edge cases in this approach, more specifically, this approach is not idempotent, in fact the order of the machines deletion is important: first the linked clones than the "master".
>> You can add an ordering step before delete.
>
> Â
> If I have correctly understood you are suggesting to have also a check inside "UnregisterMachineIfExistsAndDeleteItsMedia(machine)" to recursively find & order all the clones of the given machine.Â
>
> In fact sometimes you cannot delete a 'master' machine, if it has been linked cloned, because its hd is shared with other clones. In that case it is reasonable to delete all the machines "attached to that master" to finally delete the master.
>
> Maybe we need to improve VmSpec domain class with the list of linked clones. wdyt?VmSpec is probably best used for specs to launch and a name like Vm is better for runtime data like current children, imho. Wdyt?
sweet
>>
>> >>
>> >> >
>> >> > VmSpec IMachineToVmSpec(IMachine)
>> >>
>> >> Iterable<VmSpec> specs = Iterables.transform(clones,
>> >> IMachines.toVmSpec());
>> >
>> > This is implemented and already accepted in jclouds/jclouds.
>> Good job on that.
>>
>> >>
>> >> >
>> >> > UnregisterMachineIfExistsAndDeleteItsMedia(VmSpec)
>> >> Iterable<Boolean> deletedOrDidntExist = Iterables.transform(specs,
>> >> VmSpecs.unregisterAndDeleteMediaIfExists(vboxmgr));
>> >>
>> >> Note this could be ...
>> >> Functions.compose(unregisterIfExists,deleteMedia) which is easier to test.
>> >
>> > I completely agree with this. Good idea.
>> Cool
>
> In this way we can offer the same functionality offered by vbox api:
> unregister without delete doesn't make sense to me, in general, but we can
> imagine some scenarios where it can be useful.
then stick with unregisterAndDeleteMediaIfExists.
retrieving children is less important than knowing if the VM is a
linked clone or not. if you can somehow tell that it is a linked
clone, then you can order it above those who aren't. Any way to do
this instead?
Hi, Andrea
Thanks for keeping on :)
Right, so if we can tell whether something is a clone or not, seems we can order properly.
Does a full clone have the same delete children first requirement? Or is it completely independent of its source?
I think full clones will be useful to those running i/o heavy or long running vms. Priority is linked though, imho.
-A
Hi, Andrea
Thanks for keeping on :)
Right, so if we can tell whether something is a clone or not, seems we can order properly.
Does a full clone have the same delete children first requirement? Or is it completely independent of its source?
I think full clones will be useful to those running i/o heavy or long running vms. Priority is linked though, imho.
In the above is true, an aggregate delete command who affects
unordered vms (ex. clone1-master1, master1, clone2-master1) could sort
these first (clone1-master1, clone2-master1, master1) so that the
delete will work fine.
If a delete command tries to affect only a master (ex. master1) where
clones still exist, then the user would get a reasonable error back.
-A
So I'd like to add
private void ensureMachineHasGuestAdditionsInstalled(String vmName) {
machineUtils.lockSessionOnMachineAndApply(vmName,
LockType.Shared, new GuestAdditionsInstaller(context, manager,
executionType));
}
but do you think it makes sense to pass ComputeServiceContext context
to GuestAdditionsInstaller to be able to run inside
GuestAdditionsInstaller something like
context.getComputeService().submitScriptOnNode(vmMetadata.getId(),
statementList,
runAsRoot(true).wrapInInitScript(false));
Thanks in advance
I'm almost finished with the GuestAdditionsInstaller function. I think
we need to change CreateAndInstallVm function cause we can assume that
a vm is ready when the GuestAdditions are installed.
So I'd like to add
private void ensureMachineHasGuestAdditionsInstalled(String vmName) {
   machineUtils.lockSessionOnMachineAndApply(vmName,
LockType.Shared, new GuestAdditionsInstaller(context, manager,
executionType));
}
Right we don't need the lock here, just to run a script.
Thanks,Andrea
I'm spending some time in vbox to fix LiveTest.
At the moment all tests are ok but those:
Failed tests:
testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials(org.jclouds.virtualbox.compute.VirtualBoxComputeServiceAdapterLiveTest):
imageId(ubuntu-11.04-server-i386) not found
testListLocations(org.jclouds.virtualbox.compute.VirtualBoxComputeServiceAdapterLiveTest):
expected:<false> but was:<true>
Before changing the code, I'd like to better understand:
@Override
public Iterable<Location> listLocations() {
// Not using the adapter to determine locations
return ImmutableSet.<Location>of();
}
contains this comment. What does it mean exactly?
while testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials fails
because of
Template template = context.getComputeService().templateBuilder().build();
How can I improve the default template?
Thanks,
Andrea
Hi team,
I'm spending some time in vbox to fix LiveTest.
At the moment all tests are ok but those:
Failed tests:
testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials(org.jclouds.virtualbox.compute.VirtualBoxComputeServiceAdapterLiveTest):
imageId(ubuntu-11.04-server-i386) not found
 testListLocations(org.jclouds.virtualbox.compute.VirtualBoxComputeServiceAdapterLiveTest):
expected:<false> but was:<true>
Before changing the code, I'd like to better understand:
 @Override
 public Iterable<Location> listLocations() {
   // Not using the adapter to determine locations
   return ImmutableSet.<Location>of();
 }
contains this comment. What does it mean exactly?
while testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials fails
because of
   Template template = context.getComputeService().templateBuilder().build();
How can I improve the default template?
my comments inline.
On Fri, Feb 17, 2012 at 3:42 PM, Adrian Cole <adrian...@gmail.com> wrote:
> Hi, Andrea.
>
> Thanks for the attempt to summarize, notes below.
>
> On Fri, Feb 17, 2012 at 4:33 PM, Andrea Turli <andrea...@gmail.com>
> wrote:
>>
>> Hi team,
>>
>> I'm spending some time in vbox to fix LiveTest.
>>
>> At the moment all tests are ok but those:
>>
>> Failed tests:
>>
>> testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials(org.jclouds.virtualbox.compute.VirtualBoxComputeServiceAdapterLiveTest):
>> imageId(ubuntu-11.04-server-i386) not found
>>
>> Â testListLocations(org.jclouds.virtualbox.compute.VirtualBoxComputeServiceAdapterLiveTest):
>> expected:<false> but was:<true>
>>
>> Before changing the code, I'd like to better understand:
>>
>> Â @Override
>> Â public Iterable<Location> listLocations() {
>> Â Â Â // Not using the adapter to determine locations
>> Â Â Â return ImmutableSet.<Location>of();
>> Â }
>
> virtualbox is not producing locations (ex. datacenters, hosts, etc.), at
> least not yet. If there is a test that checks for locations based on the
> adapter, change or remove it.
>
ok, I'll remove it.
>>
>>
>> contains this comment. What does it mean exactly?
>>
>>
>> while testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials fails
>> because of
>>
>> Â Â Â Template template =
>> context.getComputeService().templateBuilder().build();
>>
>> How can I improve the default template?
>
> this is not enough information to comment, and a nit is "How can I improve
> the default template?" is probably not what you are seeking. Rather you
> want to figure out why whatever is failing. You should start by describing
> what exactly is failing? is it that no template matches? If so, what are
> the available images retrieved with listImages, etc?
>
> There's probabably a stack trace or something related, or some information
> about the line that failed, etc. Especially when asking for help offline,
> you'll want to give us a chance to do so without necessarily running
> virtualbox itself. Best way of facilitating your answer is to be somewhat
> detailed about what you were expecting vs what occurred.
>>
>>
Sorry for the poor description of the problem.
testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials fails with
this stacktrace:
java.util.NoSuchElementException: imageId(ubuntu-11.04-server-i386) not found
at org.jclouds.compute.domain.internal.TemplateBuilderImpl.build(TemplateBuilderImpl.java:636)
at org.jclouds.compute.domain.internal.TemplateBuilderImpl.build(TemplateBuilderImpl.java:622)
at org.jclouds.virtualbox.compute.VirtualBoxComputeServiceAdapterLiveTest.testCreateNodeWithGroupEncodedIntoNameThenStoreCredentials(VirtualBoxComputeServiceAdapterLiveTest.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:691)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:883)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1208)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:753)
at org.testng.TestRunner.run(TestRunner.java:613)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:335)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:330)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:292)
at org.testng.SuiteRunner.run(SuiteRunner.java:241)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1169)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1094)
at org.testng.TestNG.run(TestNG.java:1006)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:107)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:199)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:170)
So the template doesn't match any image. In fact, listImages() return
an empty collection.
We need to ensure that at least the *default master image* is created
before running CreateNodeWithGroupEncodedIntoNameThenStoreCredentials.
Does it make sense?
The other option could be to use the yaml description of the machines
instead of the actual machines in listImages() to support a a lazy
master creation, without touching the template matching mechanism.
This second approach is more generic but not super easy.
Thanks
I'd like to organize a quick meeting to summarize the situation for virtualbox.
At the moment the situation is pretty much the following:
- we are able to create a Master machine with GuestAdditions installed
and with the udev network files cleaned in case of ubuntu os.
- we are able to clone from a Master a VM
To do:
- we need to remove the OS iso from the Master
- we need to replace the NAT adapter to Bridged adapter in the Master
to simplify the cloning step
At this regard,
- we need also to review the NetworkSpec class: at the moment contains
reference only to NatAdapter set and I think the general concept is
more generic than that, for example Bridged adapter.
we could decide to have a wrapper class (i.e. NetworkAdapter around
INetworkAdapter)
- VirtualBoxComputeServiceAdapterLiveTest are not passing: basically
because the default template doesn't match any image.
In fact, listImages() return an empty collection. We need to ensure
that at least the *default master image* is created before running
CreateNodeWithGroupEncodedIntoNameThenStoreCredentials.
The other option could be to use the yaml description of the
machines instead of the actual machines in listImages() to support a a
lazy master creation, without touching the template matching
mechanism.
Does it make sense?
I was thinking to organize a meeting to discuss these stuff (and more,
if you want) during this week.
Please use this doodle
http://www.doodle.com/m725xzcvai8ibdx7
Andrea
Let's do tonight 20.00!
/M
Nice to see the progress! I also started on a similar path yesterday
but did not get far enough to commit anything. I was planning on
working on vbox tomorrow evening, so maybe we can try and puzzle this
together tomorrow evening (CET) if you have the possibility to be
online?
Cheers, Mattias
Tomorrow evening is good for me after 20 WET or before 17 WET.
meet @ irc right?
Cheers
-david
-A
Still with regard to the circular dependency stuff i've searched pretty much everywhere and can't seem to find an example where ComputeServiceContext is injected into a function or predicate as in CreateAndInstallVm. Most everywhere else it seems ComputeServiceContext is not used outside *Builder and *ContextModule which makes me think that it shouldn't be injected at all.
in virtually every case i've seen (in virtualbox) ComputeServiceContext is used to get an instance of ComputeService to submit scripts (e.g GuestAdditionsInstaller). As binding is done by VirtualBoxComputeServiceContextModule *while* ComputeServiceContext is being build it stands to reason that ComputeServiceContext cannot be injected (because its not built yet).
Adrian: any pointers? even a quick clue would be nice.
Cheers
-david
I think the trick here is that there's really two computeservices we
should have. The internal one we need to control the vbox host, and
the one we are constructing.
binding the host computeservice explicity, will unravel the circular dependency.
ex.
bind(ComputeService.class).annotatedWith(Host.class).to(fromBYON)
or..
@Provides
@Singleton
@Host (assuming we have or can create an @Qualifier annotation)
protected ComputeService provideHostController(inputs to byon)
Then, in the utilities you need, just bind the qualified ComputeServiceContext.
ex.
@Inject
MyFunction(@Host ComputeService hostController)
...
Here, a diagram could help, and is something we can work on Sunday.
I hope this helps in the mean time.
-A
thanks for the insight, I think I got the gist of it.
I will experiment with that, If I get stuck again we can continue sunday.
thanks
-david
Fyi. I got up too early, so I'll be online in a half hour to follow up with stuff including andrea's vbox pull review.
-A
I will look at your code soon.
Andrea
Hi, David.
Sounds like great progress, and I'm sure Andrea can help sort out the networking glitch. Good idea to send a pull req. I'll watch for it.
-A
Sounds good.. we just need somebody brave enough to sort out a native
bound adapter :)
I'd try using that
in a different package. Â Ex. a LOT of the code is the same, regardless
of which api is used (ex. image construction, guest additions, etc),
so maybe make a package org.jclouds.virtualbox.xpcom and put things
like a ComputeServiceAdapter that uses xpcom?
wdyt?
Nice job. Merged.
Anybody have a favorite wsdl generator to recommend?
-A
Thanks Steve,
this is really interesting I'll give a look later today.
Thanks,
Andrea
On Mon, Oct 8, 2012 at 10:33 AM, Steve Loughran <ste...@hortonworks.com> wrote:
> On 7 October 2012 13:40, Andrea Turli <andrea...@gmail.com> wrote:
>
>> Sure I'll add this information to the jclouds-virtualbox documentation.
>>
>> Yesterday Ioannis was adding the vritualbox api to the jclouds-karaf
>> features that are used by jclouds-cli, so that we can use virtualbox
>> from the cli.
>> He noticed that vboxjws is LGPL2 licensed which is not compatible with
>> the ASL license. So he thinks that it is not possible package it
>> inside the cli itself.
>>
>> This is a big problem for jclouds and whirr in general, I guess, so we
>> need to find a solution.
>>
>> Ioannis was suggesting to ask Oracle to relicense the jar
>> Technically it is also possible to avoid the usage of vbox web service
>> and either ssh to host machine and run the vbox command on it
>> (vagrant/veewee approach) or use java native approach to run the C++
>> vbox commands.
>>
>>
> 1. I've used the command line, but all my proposed "apache chaos" library
> does is kill the VM without warning
>
> https://github.com/hortonworks/availability/blob/master/hmonitor/src/main/groovy/org/apache/chaos/infra/vbox/VBoxManage.groovy
>
> 2. It's a web service API -all it takes is someone to take the service API
> definition and write a new WS client for it. Given the JAX-WS client code
> is built into the current JREs, I'd go with that
>
> someone has already done this in the past
> http://jax-ws-commons.java.net/nonav/virtualbox/
> http://jax-ws-commons.java.net/nonav/virtualbox/apidocs/
Thanks Patrick,
the ssh trick can totally help.
Parsing is not the only problem:
without the stub, all the domain classes are gone, so I need to recreate all the pojo classes by hand (IMachine, INetworkAdapter etc)
Thoughts?
Andrea
ssh overhead can be minimized by using something like ssh contro session, where all your subsequent ssh connection happen over an established ssh tunnel. see ssh controlpath
many of the ssh command like status have a way to have the output in machinereadable output, so parsing is pretty easy.
Thanks for the tenacity, Andrea!