Re: [openstack-dev] [Mistral] Query on creating multiple resources

2014-12-09 Thread Renat Akhmerov
Hundred percent agree with all said by Zane.

Renat Akhmerov
@ Mirantis Inc.



> On 10 Dec 2014, at 02:20, Zane Bitter  wrote:
> 
> On 09/12/14 03:48, Renat Akhmerov wrote:
>> Hey,
>> 
>> I think it’s a question of what the final goal is. For just creating 
>> security groups as a resource I think Georgy and Zane are right, just use 
>> Heat. If the goal is to try Mistral or have this simple workflow as part of 
>> more complex then it’s totally fine to use Mistral. Sorry, I’m probably 
>> biased because Mistral is our baby :). Anyway, Nikolay has already answered 
>> the question technically, this “for-each” feature will be available 
>> officially in about 2 weeks.
> 
> :)
> 
> They're not mutually exclusive, of course, and to clarify I wasn't suggesting 
> replacing Mistral with Heat, I was suggesting replacing a bunch of 'create 
> security group' steps in a larger workflow with a single 'create stack' step.
> 
> In general, though:
> - When you are just trying to get to a particular end state and it doesn't 
> matter how you get there, Heat is a good solution.
> - When you need to carry out a particular series of steps, and it is the 
> steps that are well-defined, not the end state, then Mistral is a good 
> solution.
> - When you have a well-defined end state but some steps need to be done in a 
> particular way that isn't supported by Heat, then Mistral can be a solution 
> (it's not a _good_ solution, but that isn't a criticism because it isn't 
> Mistral's job to make up for deficiencies in Heat).
> - Both services are _highly_ complementary. For example, let's say you have a 
> batch job to run regularly: you want to provision a server, do some work on 
> it, and then remove the server when the work is complete. (An example that a 
> lot of people will be doing pretty regularly might be building a custom VM 
> image and uploading it to Glance.) This is a classic example of a workflow, 
> and you should use Mistral to implement it. Now let's say that rather than 
> just a single server you have a complex group of resources that need to be 
> set up prior to running the job. You could encode all of the steps required 
> to correctly set up and tear down all of those resources in the Mistral 
> workflow, but that would be a mistake. While the overall process is still a 
> workflow, the desired state after creating all of the resources but before 
> running the job is known, and it doesn't matter how you get there. Therefore 
> it's better to define the resources in a Heat template: unless you are doing 
> something really weird it will Just Work(TM) for creating them all in the 
> right order with optimal parallelisation, it knows how to delete them 
> afterwards too without having to write it again backwards, and you can easily 
> test it in isolation from the rest of the workflow. So you would replace the 
> steps in the workflow that create and delete the server with steps that 
> create and delete a stack.
> 
>>> Create VM workflow was a demo example. Mistral potentially can be used by 
>>> Heat or other orchestration tools to do actual interaction with API, but 
>>> for user it might be easier to use Heat functionality.
>> 
>> I kind of disagree with that statement. Mistral can be used by whoever finds 
>> its useful for their needs. Standard “create_instance” workflow (which is in 
>> “resources/workflows/create_instance.yaml”) is not so a demo example as 
>> well. It does a lot of good stuff you may really need in your case (e.g. 
>> retry policies). Even though it’s true that it has some limitations we’re 
>> aware of. For example, when it comes to configuring a network for newly 
>> created instance it’s now missing network related parameters to be able to 
>> alter behavior.
> 
> I agree that it's unlikely that Heat should replace Mistral in many of the 
> Mistral demo scenarios. I do think you could make a strong argument that Heat 
> should replace *Nova* in many of those scenarios though.
> 
> cheers,
> Zane.
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Query on creating multiple resources

2014-12-09 Thread Zane Bitter

On 09/12/14 03:48, Renat Akhmerov wrote:

Hey,

I think it’s a question of what the final goal is. For just creating security 
groups as a resource I think Georgy and Zane are right, just use Heat. If the 
goal is to try Mistral or have this simple workflow as part of more complex 
then it’s totally fine to use Mistral. Sorry, I’m probably biased because 
Mistral is our baby :). Anyway, Nikolay has already answered the question 
technically, this “for-each” feature will be available officially in about 2 
weeks.


:)

They're not mutually exclusive, of course, and to clarify I wasn't 
suggesting replacing Mistral with Heat, I was suggesting replacing a 
bunch of 'create security group' steps in a larger workflow with a 
single 'create stack' step.


In general, though:
- When you are just trying to get to a particular end state and it 
doesn't matter how you get there, Heat is a good solution.
- When you need to carry out a particular series of steps, and it is the 
steps that are well-defined, not the end state, then Mistral is a good 
solution.
- When you have a well-defined end state but some steps need to be done 
in a particular way that isn't supported by Heat, then Mistral can be a 
solution (it's not a _good_ solution, but that isn't a criticism because 
it isn't Mistral's job to make up for deficiencies in Heat).
- Both services are _highly_ complementary. For example, let's say you 
have a batch job to run regularly: you want to provision a server, do 
some work on it, and then remove the server when the work is complete. 
(An example that a lot of people will be doing pretty regularly might be 
building a custom VM image and uploading it to Glance.) This is a 
classic example of a workflow, and you should use Mistral to implement 
it. Now let's say that rather than just a single server you have a 
complex group of resources that need to be set up prior to running the 
job. You could encode all of the steps required to correctly set up and 
tear down all of those resources in the Mistral workflow, but that would 
be a mistake. While the overall process is still a workflow, the desired 
state after creating all of the resources but before running the job is 
known, and it doesn't matter how you get there. Therefore it's better to 
define the resources in a Heat template: unless you are doing something 
really weird it will Just Work(TM) for creating them all in the right 
order with optimal parallelisation, it knows how to delete them 
afterwards too without having to write it again backwards, and you can 
easily test it in isolation from the rest of the workflow. So you would 
replace the steps in the workflow that create and delete the server with 
steps that create and delete a stack.



Create VM workflow was a demo example. Mistral potentially can be used by Heat 
or other orchestration tools to do actual interaction with API, but for user it 
might be easier to use Heat functionality.


I kind of disagree with that statement. Mistral can be used by whoever finds 
its useful for their needs. Standard “create_instance” workflow (which is in 
“resources/workflows/create_instance.yaml”) is not so a demo example as well. 
It does a lot of good stuff you may really need in your case (e.g. retry 
policies). Even though it’s true that it has some limitations we’re aware of. 
For example, when it comes to configuring a network for newly created instance 
it’s now missing network related parameters to be able to alter behavior.


I agree that it's unlikely that Heat should replace Mistral in many of 
the Mistral demo scenarios. I do think you could make a strong argument 
that Heat should replace *Nova* in many of those scenarios though.


cheers,
Zane.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Query on creating multiple resources

2014-12-09 Thread Renat Akhmerov
No problem, let us know if you have any other questions.

Renat Akhmerov
@ Mirantis Inc.



> On 09 Dec 2014, at 11:57, Sushma Korati  wrote:
> 
> 
> Hi,
> 
> Thank you guys.
> 
> Yes I am able to do this with heat, but I faced issues while trying the same 
> with mistral.
> As suggested will try with the latest mistral branch. Thank you once again. 
> 
> Regards,
> Sushma
> 
> 
> 
>  
> From: Georgy Okrokvertskhov [mailto:gokrokvertsk...@mirantis.com 
> <mailto:gokrokvertsk...@mirantis.com>] 
> Sent: Tuesday, December 09, 2014 6:07 AM
> To: OpenStack Development Mailing List (not for usage questions)
> Subject: Re: [openstack-dev] [Mistral] Query on creating multiple resources
>  
> Hi Sushma,
>  
> Did you explore Heat templates? As Zane mentioned you can do this via Heat 
> template without writing any workflows. 
> Do you have any specific use cases which you can't solve with Heat template?
>  
> Create VM workflow was a demo example. Mistral potentially can be used by 
> Heat or other orchestration tools to do actual interaction with API, but for 
> user it might be easier to use Heat functionality.
>  
> Thanks,
> Georgy
>  
> On Mon, Dec 8, 2014 at 7:54 AM, Nikolay Makhotkin  <mailto:nmakhot...@mirantis.com>> wrote:
> Hi, Sushma! 
> 
> Can we create multiple resources using a single task, like multiple keypairs 
> or security-groups or networks etc?
>  
> Yes, we can. This feature is in the development now and it is considered as 
> experimental 
> -https://blueprints.launchpad.net/mistral/+spec/mistral-dataflow-collections 
> <https://blueprints.launchpad.net/mistral/+spec/mistral-dataflow-collections>
>  
> Just clone the last master branch from mistral.
> 
> You can specify "for-each" task property and provide the array of data to 
> your workflow: 
> 
>  
> version: '2.0'
> 
> name: secgroup_actions
> 
> workflows:
>   create_security_group:
> type: direct
> input:
>   - array_with_names_and_descriptions
> 
> tasks:
>   create_secgroups:
> for-each: 
>   data: $.array_with_names_and_descriptions
> action: nova.security_groups_create name={$.data.name 
> <http://data.name/>} description={$.data.description}
> 
>  
> On Mon, Dec 8, 2014 at 6:36 PM, Zane Bitter  <mailto:zbit...@redhat.com>> wrote:
> On 08/12/14 09:41, Sushma Korati wrote:
> Can we create multiple resources using a single task, like multiple
> keypairs or security-groups or networks etc?
> 
> Define them in a Heat template and create the Heat stack as a single task.
> 
> - ZB
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org <mailto:OpenStack-dev@lists.openstack.org>
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev 
> <http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev>
> 
> 
>  
> -- 
> Best Regards,
> Nikolay
> 
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org <mailto:OpenStack-dev@lists.openstack.org>
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev 
> <http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev>
> 
> 
>  
> -- 
> Georgy Okrokvertskhov
> Architect,
> OpenStack Platform Products,
> Mirantis
> http://www.mirantis.com <http://www.mirantis.com/>
> Tel. +1 650 963 9828
> Mob. +1 650 996 3284
> DISCLAIMER == This e-mail may contain privileged and confidential 
> information which is the property of Persistent Systems Ltd. It is intended 
> only for the use of the individual or entity to which it is addressed. If you 
> are not the intended recipient, you are not authorized to read, retain, copy, 
> print, distribute or use this message. If you have received this 
> communication in error, please notify the sender and delete all copies of 
> this message. Persistent Systems Ltd. does not accept any liability for virus 
> infected mails.
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org <mailto:OpenStack-dev@lists.openstack.org>
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev 
> <http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev>
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Query on creating multiple resources

2014-12-09 Thread Renat Akhmerov
Hey,

I think it’s a question of what the final goal is. For just creating security 
groups as a resource I think Georgy and Zane are right, just use Heat. If the 
goal is to try Mistral or have this simple workflow as part of more complex 
then it’s totally fine to use Mistral. Sorry, I’m probably biased because 
Mistral is our baby :). Anyway, Nikolay has already answered the question 
technically, this “for-each” feature will be available officially in about 2 
weeks.

> Create VM workflow was a demo example. Mistral potentially can be used by 
> Heat or other orchestration tools to do actual interaction with API, but for 
> user it might be easier to use Heat functionality.

I kind of disagree with that statement. Mistral can be used by whoever finds 
its useful for their needs. Standard “create_instance” workflow (which is in 
“resources/workflows/create_instance.yaml”) is not so a demo example as well. 
It does a lot of good stuff you may really need in your case (e.g. retry 
policies). Even though it’s true that it has some limitations we’re aware of. 
For example, when it comes to configuring a network for newly created instance 
it’s now missing network related parameters to be able to alter behavior.

One more thing: Now only will Heat be able to call Mistral somewhere underneath 
the surface. Mistral has already integration with Heat to be able to call it if 
needed and there’s a plan to make it even more useful and usable.

Thanks

Renat Akhmerov
@ Mirantis Inc.


___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Query on creating multiple resources

2014-12-08 Thread Sushma Korati

Hi,


Thank you guys.


Yes I am able to do this with heat, but I faced issues while trying the same 
with mistral.

As suggested will try with the latest mistral branch. Thank you once again.


Regards,

Sushma





From: Georgy Okrokvertskhov [mailto:gokrokvertsk...@mirantis.com]
Sent: Tuesday, December 09, 2014 6:07 AM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [Mistral] Query on creating multiple resources

Hi Sushma,

Did you explore Heat templates? As Zane mentioned you can do this via Heat 
template without writing any workflows.
Do you have any specific use cases which you can't solve with Heat template?

Create VM workflow was a demo example. Mistral potentially can be used by Heat 
or other orchestration tools to do actual interaction with API, but for user it 
might be easier to use Heat functionality.

Thanks,
Georgy

On Mon, Dec 8, 2014 at 7:54 AM, Nikolay Makhotkin 
mailto:nmakhot...@mirantis.com>> wrote:
Hi, Sushma!
Can we create multiple resources using a single task, like multiple keypairs or 
security-groups or networks etc?

Yes, we can. This feature is in the development now and it is considered as 
experimental - 
https://blueprints.launchpad.net/mistral/+spec/mistral-dataflow-collections

Just clone the last master branch from mistral.

You can specify "for-each" task property and provide the array of data to your 
workflow:

 

version: '2.0'

name: secgroup_actions

workflows:
  create_security_group:
type: direct
input:
  - array_with_names_and_descriptions

tasks:
  create_secgroups:

for-each:

  data: $.array_with_names_and_descriptions
action: nova.security_groups_create 
name={$.data.name<http://data.name>} description={$.data.description}


On Mon, Dec 8, 2014 at 6:36 PM, Zane Bitter 
mailto:zbit...@redhat.com>> wrote:
On 08/12/14 09:41, Sushma Korati wrote:
Can we create multiple resources using a single task, like multiple
keypairs or security-groups or networks etc?

Define them in a Heat template and create the Heat stack as a single task.

- ZB

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org<mailto:OpenStack-dev@lists.openstack.org>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



--
Best Regards,
Nikolay

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org<mailto:OpenStack-dev@lists.openstack.org>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



--
Georgy Okrokvertskhov
Architect,
OpenStack Platform Products,
Mirantis
http://www.mirantis.com<http://www.mirantis.com/>
Tel. +1 650 963 9828
Mob. +1 650 996 3284

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Query on creating multiple resources

2014-12-08 Thread Sushma Korati
Hello All,


Can we create multiple resources using a single task, like multiple keypairs or 
security-groups or networks etc?


I am trying to extend the existing "create_vm" workflow, such that it accepts a 
list of security groups. In the workflow, before create_vm I am trying to 
create the security group if it does not exist.


Just to test the security group functionality individually I wrote a sample 
workflow:



version: '2.0'

name: secgroup_actions

workflows:
  create_security_group:
type: direct
input:
  - name
  - description

tasks:
  create_secgroups:
action: nova.security_groups_create name={$.name} 
description={$.description}


This is a straight forward workflow, but I am unable figure out how to pass 
multiple security groups to the above workflow.

I tried passing multiple dicts in context file but it did not work.

--

{
  "name": "secgrp1",
  "description": "using mistral"
},
{
  "name": "secgrp2",
  "description": "using mistral"
}

-

Is there any way to modify this workflow such that it creates more than one 
security group?

Please help.


Regards,

Sushma


DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Query on creating multiple resources

2014-12-08 Thread Georgy Okrokvertskhov
Hi Sushma,

Did you explore Heat templates? As Zane mentioned you can do this via Heat
template without writing any workflows.
Do you have any specific use cases which you can't solve with Heat template?

Create VM workflow was a demo example. Mistral potentially can be used by
Heat or other orchestration tools to do actual interaction with API, but
for user it might be easier to use Heat functionality.

Thanks,
Georgy

On Mon, Dec 8, 2014 at 7:54 AM, Nikolay Makhotkin 
wrote:

> Hi, Sushma!
>
> Can we create multiple resources using a single task, like multiple
>> keypairs or security-groups or networks etc?
>
>
> Yes, we can. This feature is in the development now and it is considered
> as experimental -
> https://blueprints.launchpad.net/mistral/+spec/mistral-dataflow-collections
>
> Just clone the last master branch from mistral.
>
> You can specify "for-each" task property and provide the array of data to
> your workflow:
>
>  
>
> version: '2.0'
>
> name: secgroup_actions
>
> workflows:
>   create_security_group:
> type: direct
> input:
>   - array_with_names_and_descriptions
>
> tasks:
>   create_secgroups:
>
> for-each:
>
>   data: $.array_with_names_and_descriptions
> action: nova.security_groups_create name={$.data.name}
> description={$.data.description}
> 
>
> On Mon, Dec 8, 2014 at 6:36 PM, Zane Bitter  wrote:
>
>> On 08/12/14 09:41, Sushma Korati wrote:
>>
>>> Can we create multiple resources using a single task, like multiple
>>> keypairs or security-groups or networks etc?
>>>
>>
>> Define them in a Heat template and create the Heat stack as a single task.
>>
>> - ZB
>>
>> ___
>> OpenStack-dev mailing list
>> OpenStack-dev@lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>>
>
>
>
> --
> Best Regards,
> Nikolay
>
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>


-- 
Georgy Okrokvertskhov
Architect,
OpenStack Platform Products,
Mirantis
http://www.mirantis.com
Tel. +1 650 963 9828
Mob. +1 650 996 3284
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Query on creating multiple resources

2014-12-08 Thread Nikolay Makhotkin
Hi, Sushma!

Can we create multiple resources using a single task, like multiple
> keypairs or security-groups or networks etc?


Yes, we can. This feature is in the development now and it is considered as
experimental -
https://blueprints.launchpad.net/mistral/+spec/mistral-dataflow-collections

Just clone the last master branch from mistral.

You can specify "for-each" task property and provide the array of data to
your workflow:

 

version: '2.0'

name: secgroup_actions

workflows:
  create_security_group:
type: direct
input:
  - array_with_names_and_descriptions

tasks:
  create_secgroups:

for-each:

  data: $.array_with_names_and_descriptions
action: nova.security_groups_create name={$.data.name}
description={$.data.description}


On Mon, Dec 8, 2014 at 6:36 PM, Zane Bitter  wrote:

> On 08/12/14 09:41, Sushma Korati wrote:
>
>> Can we create multiple resources using a single task, like multiple
>> keypairs or security-groups or networks etc?
>>
>
> Define them in a Heat template and create the Heat stack as a single task.
>
> - ZB
>
> ___
> OpenStack-dev mailing list
> OpenStack-dev@lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
Best Regards,
Nikolay
___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Mistral] Query on creating multiple resources

2014-12-08 Thread Zane Bitter

On 08/12/14 09:41, Sushma Korati wrote:

Can we create multiple resources using a single task, like multiple
keypairs or security-groups or networks etc?


Define them in a Heat template and create the Heat stack as a single task.

- ZB

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Mistral] Query on creating multiple resources

2014-12-08 Thread Sushma Korati
Hello All,


Can we create multiple resources using a single task, like multiple keypairs or 
security-groups or networks etc?


I am trying to extend the existing "create_vm" workflow, such that it accepts a 
list of security groups. In the workflow, before create_vm I am trying to 
create the security group if it does not exist.


Just to test the security group functionality individually I wrote a sample 
workflow:



version: '2.0'

name: secgroup_actions

workflows:
  create_security_group:
type: direct
input:
  - name
  - description

tasks:
  create_secgroups:
action: nova.security_groups_create name={$.name} 
description={$.description}


This is a straight forward workflow, but I am unable figure out how to pass 
multiple security groups to the above workflow.

I tried passing multiple dicts in context file but it did not work.

--

{
  "name": "secgrp1",
  "description": "using mistral"
},
{
  "name": "secgrp2",
  "description": "using mistral"
}

-

Is there any way to modify this workflow such that it creates more than one 
security group?

Please help.


Regards,

Sushma


DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.

___
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev