hi Daan, That's the sort of thing I was thinking of, yes. Perhaps something like a VanillaSoftwareProcess that you can run, with some config to hold the settings for the network, and a "launch.command" [1] to create the network using the CLI, and a "stop.command" to destroy it.
The trouble with using VanillaSoftwareProcess for this purpose is that you typically run it in a cloud location, resulting in the creation of a VM. You give the VanillaSoftwareProcess an install.command that will install whatever dependencies you have, and a start and stop command to make it do what you need. In your case I expect you don't want to have to create a VM just to install the CLI and then issue commands to create the network. On the other hand, in your case you are running Brooklyn on the same machine as Cloudstack, so you may have the CLI available already? In that case you could run the VanillaSoftwareProcess with "location: localhost", and do without any install.command to install the CLI. As you are running on localhost (the Brooklyn node), no VM is needed. A nicer way to do it might be to write an entity with a start and stop effector that are HttpCommandEffectors [2]. These would directly issue the API calls to create/destroy the network. I give an example of what I was thinking of below [4], but actually it would be pretty tricky to do it in YAML given the aspect of signing the request for auth purposes. regards Geoff [1] http://brooklyn.apache.org/v/latest/blueprints/custom-entities.html#vanilla-software-using-bash [2] http://brooklyn.apache.org/v/latest/misc/javadoc/org/apache/brooklyn/core/effector/http/HttpCommandEffector.html [3] https://brooklyn.apache.org/v/latest/blueprints/entity-configuration.html#configuration-in-a-catalog-item [4] YAML example brooklyn.catalog: version: 0.1.0-SNAPSHOT items: - id: http-effector-example itemType: entity name: HTTP Effector Example item: type: org.apache.brooklyn.entity.software.base.EmptySoftwareProcess brooklyn.parameters: - name: "network.name" description: "network name" - name: "zone.id" description: "the zone ID for the network" brooklyn.initializers: - type: org.apache.brooklyn.core.effector.http.HttpCommandEffector brooklyn.config: name: start httpVerb: "POST" uri: http://localhost:8080/client/api?command=createNetwork httpPayload: $brooklyn:formatString: - "name=%s&zoneid=%s" - $brooklyn:config("network.name") - $brooklyn:config("zone.id") publishSensor: test1 jsonPath: "$.resp" On Fri, 2 Jun 2017 at 13:08 Daan Hoogland <[email protected]> wrote: > I am not sure if I get what you are saying but being a bit familiar with > cloudmonkey; Are you saying that I should call cloudmonkey from the camp > yaml is some way? Or do you mean for me to write some supportive code that > then makes it possible to use the CAMP YAML in the generic way using the > location that specifies the cloud-type? > > On 02/06/2017, 11:21, "Geoff Macartney" <[email protected]> > wrote: > > hi Daan (and other Brooklyners - question below), > > There isn't (yet) a portable network abstraction in Brooklyn, i.e. you > can't write a blueprint that says "create me a network" and then run > it on > some arbitrary cloud, where it will do the cloud specific thing. That > may > come along, but in the mean time you will likely have to arrange to > issue > the commands to create the network yourself. > > There are different ways you could do that; I see there is a CLI (more > than > one in fact?) for Cloudstack, and there is of course also the REST > API. I > imagine the best way to do this would be to write an entity that will > allow > you to manage the network, with a start effector to create it and a > stop > effector to remove it. The start effector would use either the CLI > or the > REST API to issue the create command, and similarly for the stop. > > While you could certainly do this in Java I think it may also be > possible > to write the entity in YAML, depending on what all you want to do with > it. > > Does anyone on the mailing list have any good examples of how to do > this > sort of thing? > > Geofff > > On Fri, 2 Jun 2017 at 08:46 Daan Hoogland <[email protected] > > > wrote: > > > Thanks, > > > > Next step: Can I have Brooklyn create my networks in cloudstack? > > And delete it again at the end of my life cycle? > > > > I have only found how reference the network to use with the field > > networkName. > > But I want it not to be pre-existing. > > > > > > On 02/06/2017, 09:20, "Andrea Turli" <[email protected] > > > > wrote: > > > > Daan, > > > > Looks to me you are in the right track! I'd probably start from > > > https://brooklyn.apache.org/v/latest/locations/#apache-cloudstack to > > learn > > how to select images and networks. > > > > Best, > > Andrea > > > > Il 01/giu/2017 16:57, "Daan Hoogland" < > [email protected]> ha > > scritto: > > > > H, > > > > > > > > This is a usage question but aws there is no user@ list I ended > out > > here. > > You know me as the guy asking about integration with cloudstack. > I am > > experimenting with that, now. I have a local cloudstack running > and > > available at a 10.<something> private space address on port > 8080. Now I > > have Brooklyn at the same address on port 8081. Next, I defined > the > > location as > > > > brooklyn.locations: > > > > - type: jclouds:cloudstack > > > > brooklyn.config: > > > > displayName: local cloudstack > > > > endpoint: http://10.2.2.34:8080/client/api > > > > identity: admin > > > > credential: <somepassword> > > > > does this seem complete to you people? > > > > > > > > I am trying to deploy the resilient-bash-web-cluster-template on > this > > location but am suspecting there is a lot missing before that is > > possible, > > like the right VM templates and maybe network definitions. > > > > I suspect I have a lot of reading to do so tell me to rtfm with > > pointer, > > please. > > > > > > > > Daan Hoogland > > Senior Software Developer > > *s:* +31 61400 4545 | * d: *+44(0) 20 3603 0540 > <+44%2020%203603%200540> > > <+44%2020%203603%200540> <+44%2020%203603%200540> > > *e:* [email protected] | * w: *www.shapeblue.com > |* t:* > > @shapeblue > > *a:* 53 Chandos Place, Covent Garden, London WC2N 4HSUK > > > > [image: CloudStack Collab Miami 2017] < > > http://us.cloudstackcollab.org/> > > ------------------------------ > > > > Shape Blue Ltd is a company incorporated in England & Wales. > ShapeBlue > > Services India LLP is a company incorporated in India and is > operated > > under > > license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda > is a > > company incorporated in Brasil and is operated under license > from Shape > > Blue Ltd. ShapeBlue SA Pty Ltd is a company registered by The > Republic > > of > > South Africa and is traded under license from Shape Blue Ltd. > > ShapeBlue is > > a registered trademark.This email and any attachments to it may > be > > confidential and are intended solely for the use of the > individual to > > whom > > it is addressed. Any views or opinions expressed are solely > those of > > the > > author and do not necessarily represent those of Shape Blue Ltd > or > > related > > companies. If you are not the intended recipient of this email, > you > > must > > neither take any action based upon its contents, nor copy or > show it to > > anyone. Please contact the sender if you believe you have > received this > > email in error. > > > > Find out more about ShapeBlue and our range of CloudStack related > > services: > > IaaS Cloud Design & Build > > <http://shapeblue.com/iaas-cloud-design-and-build/> | CSForge – > rapid > > IaaS > > deployment framework <http://shapeblue.com/csforge/> > > CloudStack Consulting < > http://shapeblue.com/cloudstack-consultancy/> | > > CloudStack > > Software Engineering < > > http://shapeblue.com/cloudstack-software-engineering/> > > CloudStack Infrastructure Support > > <http://shapeblue.com/cloudstack-infrastructure-support/> | > CloudStack > > Bootcamp Training Courses < > http://shapeblue.com/cloudstack-training/> > > > > > > > > > > Daan Hoogland > > Senior Software Developer > > s: +31 61400 4545 | d: +44(0) 20 3603 0540 > <+44%2020%203603%200540> <+44%2020%203603%200540> > > e: [email protected] | w: www.shapeblue.com | t: > @shapeblue > > a: 53 Chandos Place, Covent Garden, London WC2N 4HSUK > > > > > > > > Shape Blue Ltd is a company incorporated in England & Wales. > ShapeBlue > > Services India LLP is a company incorporated in India and is > operated under > > license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a > > company incorporated in Brasil and is operated under license from > Shape > > Blue Ltd. ShapeBlue SA Pty Ltd is a company registered by The > Republic of > > South Africa and is traded under license from Shape Blue Ltd. > ShapeBlue is > > a registered trademark.This email and any attachments to it may be > > confidential and are intended solely for the use of the individual > to whom > > it is addressed. Any views or opinions expressed are solely those of > the > > author and do not necessarily represent those of Shape Blue Ltd or > related > > companies. If you are not the intended recipient of this email, you > must > > neither take any action based upon its contents, nor copy or show it > to > > anyone. Please contact the sender if you believe you have received > this > > email in error. > > > > Find out more about ShapeBlue and our range of CloudStack related > services: > > IaaS Cloud Design & Build | CSForge - rapid IaaS deployment > > framework > > CloudStack Consulting | CloudStack Software Engineering > > CloudStack Infrastructure Support | CloudStack Bootcamp > Training > > Courses > > > > > > > Daan Hoogland > Senior Software Developer > s: +31 61400 4545 | d: +44(0) 20 3603 0540 <+44%2020%203603%200540> > e: [email protected] | w: www.shapeblue.com | t: @shapeblue > a: 53 Chandos Place, Covent Garden, London WC2N 4HSUK > > > > Shape Blue Ltd is a company incorporated in England & Wales. ShapeBlue > Services India LLP is a company incorporated in India and is operated under > license from Shape Blue Ltd. Shape Blue Brasil Consultoria Ltda is a > company incorporated in Brasil and is operated under license from Shape > Blue Ltd. ShapeBlue SA Pty Ltd is a company registered by The Republic of > South Africa and is traded under license from Shape Blue Ltd. ShapeBlue is > a registered trademark.This email and any attachments to it may be > confidential and are intended solely for the use of the individual to whom > it is addressed. Any views or opinions expressed are solely those of the > author and do not necessarily represent those of Shape Blue Ltd or related > companies. If you are not the intended recipient of this email, you must > neither take any action based upon its contents, nor copy or show it to > anyone. Please contact the sender if you believe you have received this > email in error. > > Find out more about ShapeBlue and our range of CloudStack related services: > IaaS Cloud Design & Build | CSForge - rapid IaaS deployment > framework > CloudStack Consulting | CloudStack Software Engineering > CloudStack Infrastructure Support | CloudStack Bootcamp Training > Courses >
