Re: [Openstack] Heat template - get port ID of 'external' instance

2016-08-01 Thread Turbo Fredriksson
Dang! Never mind. I was sure I've tried a 'string' type as the
input to volume, but apparently not..

Changing that, now it works.
--
Choose a job you love, and you will never have
to work a day in your life.


___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] Heat template - get port ID of 'external' instance

2016-08-01 Thread Turbo Fredriksson
On Aug 1, 2016, at 4:41 PM, Turbo Fredriksson wrote:

>> You actually need to explicitly export the attributes you want as outputs 
>> from the instance.yaml template, just as you defined parameters to accept 
>> the property values.


This seems to mostly working, but i'm not sure how to 'export' the
instance UUID from "instance.yaml" to "volume.yaml" via "development.yaml"
(which is the 'primary' template):

  
https://github.com/FransUrbo/Openstack-Bayour.COM/blob/master/development.yaml#L41
  
https://github.com/FransUrbo/Openstack-Bayour.COM/blob/master/instance.yaml#L83
  https://github.com/FransUrbo/Openstack-Bayour.COM/blob/master/volume.yaml#L40

This give me

  Resource CREATE failed: ValueError: resources.volume: Value must be valid 
JSON: No JSON object could be decoded

I've also tried

  value: { get_attr: [instance, instance_uuid] }

=> The Referenced Attribute (instance instance_uuid) is incorrect.
--
God gave man both a penis and a brain,
but unfortunately not enough blood supply
to run both at the same time.
- R. Williams


___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] Heat template - get port ID of 'external' instance

2016-08-01 Thread Turbo Fredriksson
On Aug 1, 2016, at 3:53 PM, Zane Bitter wrote:

> BTW I really wouldn't recommend using the OS:: namespace for your own custom 
> types.

Thanx. I'll change that 'eventually' :).

>>  floating_network_id: physical
>> #  port_id: { get_attr: [admin, networks, { get_param: network }, 0, 
>> port]}
>> #  port_id: { get_attr: [admin, networks, 0, port]}
> 
> You want the second one.

It didn't work, that's why it's commented out. I got something like
'networks isn't available' or something to that affect.

> You actually need to explicitly export the attributes you want as outputs 
> from the instance.yaml template, just as you defined parameters to accept the 
> property values.

Ok, thanx!

>  heat resource-type-template -t hot -F yaml OS::Nova::Server


Cool! Wish I knew that this weekend :). Thanx, will come in handy
in the future..
--
Geologists recently discovered that "earthquakes" are
nothing more than Bruce Schneier and Chuck Norris
communicating via a roundhouse kick-based cryptosystem.


___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


Re: [Openstack] Heat template - get port ID of 'external' instance

2016-08-01 Thread Zane Bitter

On 31/07/16 10:39, Turbo Fredriksson wrote:

I've created a environment file:

  resource_registry:
"OS::Nova::Server::Instance": 
"https://raw.githubusercontent.com/FransUrbo/Openstack-Bayour.COM/master/instance.yaml";


BTW I really wouldn't recommend using the OS:: namespace for your own 
custom types.



I then create an instance from the template:

  admin_floating:
type: OS::Neutron::FloatingIP
description: LDAP/KRB5 Admin Floating IP
properties:
  floating_network_id: physical
#  port_id: { get_attr: [admin, networks, { get_param: network }, 0, port]}
#  port_id: { get_attr: [admin, networks, 0, port]}


You want the second one.


  admin:
type: OS::Nova::Server::Instance
properties:
  name: instance
  image: { get_param: image }
  size: 5
  flavor: m1.2tiny
  network: { get_param: network }


You're assuming here that doing get_attr on your provider resource will 
automatically reach into the nested stack and pull out the attributes of 
the resource you're thinking of - which of course would require Heat to 
be clairvoyant ;)


You actually need to explicitly export the attributes you want as 
outputs from the instance.yaml template, just as you defined parameters 
to accept the property values. To make this a bit easier, you can get 
the API to generate a template that you can modify with the command:


  heat resource-type-template -t hot -F yaml OS::Nova::Server

cheers,
Zane.

___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


[Openstack] Heat template - get port ID of 'external' instance

2016-07-31 Thread Turbo Fredriksson
I've created a environment file:

  resource_registry:
"OS::Nova::Server::Instance": 
"https://raw.githubusercontent.com/FransUrbo/Openstack-Bayour.COM/master/instance.yaml";

I then create an instance from the template:

  admin_floating:
type: OS::Neutron::FloatingIP
description: LDAP/KRB5 Admin Floating IP
properties:
  floating_network_id: physical
#  port_id: { get_attr: [admin, networks, { get_param: network }, 0, port]}
#  port_id: { get_attr: [admin, networks, 0, port]}

  admin:
type: OS::Nova::Server::Instance
properties:
  name: instance
  image: { get_param: image }
  size: 5
  flavor: m1.2tiny
  network: { get_param: network }

The problem here is the 'port_id' of "admin_floating". I can't
seem to be able to get the port ID of the instance created..

If I don't rollback my stack, I can investigate the instance
using "openstack server show " and there's no network
or port in there..
--
If something's hard to do, then it's not worth doing.
- Homer Simpson


___
Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
Post to : openstack@lists.openstack.org
Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack