[openstack-dev] [heat] Issue with validation and preview due to get_attr==None

Zane Bitter zbitter at redhat.com
Mon Mar 28 18:56:30 UTC 2016


On 27/03/16 22:58, Anant Patil wrote:
>
> On 24-Mar-16 20:26, Sergey Kraynev wrote:
>> Zane, I like you idea. As example we may discuss some steps for it
>> during summit session (if it need).
>>
>> Also I have another question, which probably came in your heads a lot
> of times:

A few times, but I usually chased it out again quite quickly ;)

>> Can we somekind improve our existing approach for validation?
>> we do validation twice - before create and during it.
>> The one issue, which I also see is:
>> first validation is a synchronous operation, and It takes a lot of
>> time, for huge stacks.

If we want to solve this problem then the first thing to do is to 
profile the code and figure out why it's taking so long in the first 
place. The validation code was written without much regard for premature 
optimisation on the assumption that if we ran into problems we would do 
that. It still shouldn't be super CPU-intensive though, so if it is we 
can fix it.

I suspect that will reveal the problem to be too many ReST API calls to 
validate custom constraints. If that's the case then the solution that 
suggests itself is to stop letting individual constraints validate 
themselves and instead having something walk the template and produce a 
list of constraints that can be validated together. So e.g. you'd have 
one "nova list" call to check that the 50 servers we need exist, rather 
than 50+ "nova show" calls to check the same thing.

>> May be we need to make separate state like
>> validation for stacks ? and maybe it also allows to solve our current
>> issue with build-in functions ?

There's definitely some overlap there, but I suspect not so much that 
implementing either one or the other would get us the second one for free.

> I too had the same question since long time. I was thinking about two
> possible solutions:
>
> (1) Like you said, as of now the stack validation happens before the
> response is given to user. This is not feasible for bigger stacks; the
> RPC timesout before the stack template is even validated. I think we
> should take the request and respond immediately with a stack-id and then
> proceed with template validation and stack creation. If the template is
> not correct, the stack creation or update fails with template invalid
> error. I have been looking for this since long time, but could never work
> on it.

Yeah, this is probably a good idea, as long as we can define some 
minimum level of correctness that we require before writing to the 
database. (Specifically, enough that we can always load the stack to 
delete it again :)

> (2) Giving freedom to user to skip the validation, if they are sure
> about the template, they might want to skip the validation [1].
>
> [1]  https://review.openstack.org/#/c/182924/

I think that one's pretty problematic in general, but I'm open to some 
more specific formulations of the idea. I commented on the review.

cheers,
Zane.



More information about the OpenStack-dev mailing list