[Openstack] Can I use more than one flavors on the heat create-stack command?
Pavlo Shchelokovskyy
pshchelokovskyy at mirantis.com
Thu Oct 23 13:56:04 UTC 2014
Hi,
first of all the syntax of the command you are using is wrong, right way to
use multiple parameters in one argument would be
--parameters flavor_1=some_flavor_1_name;flavor2=some_flavor_2_name;...
or you can use it multiple times
--parameters flavor_1=some_flavor_1_name --parameters
flavor2=some_flavor_2_name
Then, if your template defines say 2 server resources with parameters
section as given in your snippet (I get that you use HOT yaml templates),
each of them referencing its own flavor parameter like
resources:
server_1:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor_1 }
....
server_2:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor_2 }
....
everything should work.
BTW, what is the Heat / OpenStack version you are using?
Best regards,
Pavlo Shchelokovskyy.
On Thu, Oct 23, 2014 at 3:58 PM, Michelakis, Spiros (NSN - GR/Athens) <
spiros.michelakis at nsn.com> wrote:
> Hi,
>
>
>
> The command I’m running the following heat command:
>
>
>
> heat *stack-create mystack --template-file ~/templates/my.yaml
> –parameters
> "key_name":"security_key","image_name":"my_image_name","cluster_identification":"tenant1","disk_config_size":"1","disk_mstate_size":"1","disk_log_size":"1","disk_services_size":"1","flavor_1":"small_flavor_1_name","flavor_2":"small_flavor_2_name"}*
>
> and this is the part of template that refers to that parameters:
>
>
>
> parameters:
>
> key_name:
>
> type: string
>
> description: Name of keypair to assign to servers
>
> image_name:
>
> type: string
>
> description: Name of image to use for servers
>
> cluster_identification:
>
> description: Cluster identification.
>
> type: string
>
> default: test
>
> flavor_1:
>
> type: string
>
> description: Flavor to use for servers
>
> default: small_flavor_1
>
> flavor_2:
>
> type: string
>
> description: Flavor to use for servers
>
> default: small_flavor_2
>
>
>
> Because I’m working on a proprietary product I cannot provide you with the
> exact template file…. L sorry about that… L
>
>
>
> My question is general:
>
> Can I run the stack-create command ( as it is explained in the manuals:
> http://docs.openstack.org/user-guide/content/heat-stack-create.html) for
> more than 1 flavors? And how? Meaning, can I specify to this command a way
> to declare different flavors assigned to let’s say 2 instances?
>
>
>
> Br
>
> -SM-
>
>
>
> *From:* ext Pavlo Shchelokovskyy [mailto:pshchelokovskyy at mirantis.com]
> *Sent:* Thursday, October 23, 2014 1:29 PM
> *To:* openstack at lists.openstack.org
> *Subject:* Re: [Openstack] Can I use more than one flavors on the heat
> create-stack command?
>
>
>
> Hi,
>
>
>
> could you please post the exact template and the exact command to create
> the stack from this template you were using when you got this error? It
> would really help to understand the problem better.
>
>
>
> Best regards,
>
> Pavlo Shchelokovskyy.
>
>
>
> On Thu, Oct 23, 2014 at 12:08 PM, Michelakis, Spiros (NSN - GR/Athens) <
> spiros.michelakis at nsn.com> wrote:
>
> Hi,
>
> I’m trying to create a stack by using heat templates. I’m using this
> command, as it is described in OSR manual:
>
> *stack-create mystack --template-file
> /PATH_TO_HEAT_TEMPLATES/WordPress_Single_Instance.template --parameters
> "InstanceType=m1.large;DBUsername=USERNAME;DBPassword=PASSWORD;KeyName=HEAT_KEY;LinuxDistribution=F17"*
>
> when I try to run this command having the same flavor for all my
> instances, it works fine. The problem raises when I want to create 2 or
> more instances with different flavors on each one of them.
>
> I’m using these parameters on the “–parameters” field on the above command:
>
>
> *{"key_name":"security_key","image_name":"my_image_name","cluster_identification":"<tenant_name>","disk_config_size":"1","disk_mstate_size":"1","disk_log_size":"1","disk_services_size":"1","flavor_1":"small_flavor_1_name","flavor_2":"small_flavor_2_name"}*
>
> The error that raises when I’m trying to execute this command is:
>
> *“error: NegativeStateReached: Object
> "id:c2dda18d-9019-4e9c-8514-245650e4b201
> name:ng-ci-20141020-184706-heat_name" negative state
> "stack_status":"CREATE_FAILED" reached (Resource CREATE failed: Error:
> Creation of server 2 failed.)”*
>
> I have checked logs under /var/log/messages and /var/log/nova/scheduler.log
> without any findings.
>
> My questions:
>
> 1. Is there any restriction on the “–parameters” field of the above
> command that prevents from running this command for more than one flavors
> in this command?
>
> 2. I have read in a forum that in order to implement this, we have to
> specify an availability zone other than the default one (nova AZ) including
> the instances we want to use on the –parameters field. Is this true? I
> cannot find any “logical explanation” behind that thought….. How the
> existence of an AZ would affect the execution of this command?
>
> I would appreciate if you could provide me with any kind of tip or
> solution for this issue.
>
> Thank you in advance for your support.
>
> BR,
>
> Michelakis Spyros
>
>
>
>
>
>
> _______________________________________________
> Mailing list:
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to : openstack at lists.openstack.org
> Unsubscribe :
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20141023/8079dded/attachment.html>
More information about the Openstack
mailing list