Currently if properties.validate() fails causing the resource
to go to CREATE_FAILED state, we get an error when creating
the event, because the bad properties are evaluated in the event
constructor. Instead create a dummy Error property with the
error string for the event.
Steven Hardy [Tue, 5 Mar 2013 15:46:08 +0000 (15:46 +0000)]
heat tests : move GenericResource into tests directory
The resource.py GenericResource type is only used in tests, so
move it into the tests area, such that it can't accidentally be
used in the main heat codebase when we fail to import any resource
plugins..
Steven Hardy [Wed, 6 Mar 2013 14:55:12 +0000 (14:55 +0000)]
heat engine : watchrule quietly discard unused metric data
Some cfn-push-stats options try to send multiple metrics to a
watch, which won't work with our simplified CW implementation
which expects exactly one Metric associated with each watch
(since that's all you can define via the template)
So quietly discard any metric data we aren't interested in.
Steven Hardy [Wed, 6 Mar 2013 14:14:53 +0000 (14:14 +0000)]
heat engine : Loadbalancer template watch reference should be Ref
Replace hard-coded reference to latency_watcher with Ref, otherwise
the name is not fully qualified for the nested stack and the engine
fails to lookup the watchrule
Angus Salkeld [Wed, 6 Mar 2013 05:28:00 +0000 (16:28 +1100)]
make parsed template snapshots before updating
This is to make sure that as the update progresses and dependant
resources are modified/replaced that we compare the original
dynamic data with the current.
Steve Baker [Wed, 6 Mar 2013 02:29:12 +0000 (15:29 +1300)]
Allow instance NetworkInterfaces to be list of str or dict
It should be possible to specify NetworkInterfaces of an instance either
as an array of strings or as an array of dicts.
The following should now be possible:
This will define nics in the order specified by DeviceIndex
"NetworkInterfaces" : [
{ "NetworkInterfaceId" : {"Ref" : "controlXface"}, "DeviceIndex" : "0" },
{ "NetworkInterfaceId" : {"Ref" : "controlXface2"}, "DeviceIndex" : "1" },
],
This will define nics in the order specified by list position
"NetworkInterfaces" : [{"Ref" : "controlXface"}, {"Ref" : "controlXface2"}],
Mixing the 2 forms is supported but the resulting order is not defined.
Amazon documentation is ambigious about which form is actually supported
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html#cfn-ec2-instance-networkinterfaces
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-ec2.html#cfn-template-snippets-eni Fixes: Bug #1096013
Change-Id: Id387d2e750cbe533a9b8a1fedc49d5bcf690fbcf
Steven Dake [Tue, 5 Mar 2013 16:01:56 +0000 (09:01 -0700)]
Stop heat services from logging to stderr by default
Change the configuration files to set use_stderr to False by
default. Oslo's log sets use_stderr to True by default, and
the only reasonable way to override is via the config files.
Steven Hardy [Mon, 4 Mar 2013 15:29:36 +0000 (15:29 +0000)]
heat clients : Make heat-boto rollback disabled by default
The boto library always sends the DisableRollback parameter,
defaulted to False, which is the opposite of the engine
default now, so we have to set DisableRollback to True in
the boto client wrapper
Steven Hardy [Mon, 4 Mar 2013 15:27:57 +0000 (15:27 +0000)]
heat clients : Change --disable-rollback to --enable-rollback
Since the engine default is now rollback disabled, flip this
switch so the user can opt-in to rollback functionality via
the --enable-rollback cli option to heat-cfn/heat-boto
Angus Salkeld [Mon, 4 Mar 2013 06:00:47 +0000 (17:00 +1100)]
Use oslo logging setup.
The one reason we kept our own version was because of the qpid
logging that is quite useful. But this is now easily done via
the "default_log_levels" option.
I have setup the api servers with:
ampqlib,qpid.messaging,keystone,eventlet
and the engine with:
ampqlib,qpid.messaging,keystone,eventlet,sqlalchemy
Zane Bitter [Fri, 1 Mar 2013 14:24:19 +0000 (15:24 +0100)]
Fix flaky unit test
This was failing intermittently during the gate tests because there was no
dependency in the template for the Instance on the WaitConditionHandle, nor
for the WaitCondition on the Instance, so the order in which resources
would be created was somewhat random.
This patch fixes the test template, and tests updating the metadata should
occur *during* creation of the stack, as well after, to replicate a real
wait condition (which won't finish creation until the metadata update
occurs).
Steven Dake [Wed, 27 Feb 2013 17:26:46 +0000 (10:26 -0700)]
Update infrastructure to more closely match other OpenStack projects
This patch imports nova's HACKING.rst guidelines altered for Heat.
This patch imports nova's run_pep8.sh with some minor alterations.
This patch imports nova's hacking.py extensions to pep8.
This patch places the run_pep8 logic in a separate file rather than
having it spread between tox.ini and run_tests.sh. The HACKING.rst
requirements as well as general pep8 requirements are then enforced
with run_pep8.sh.
Avoid running once the N802 rule until dependency changelogs are
less then 50 characters.
Steven Hardy [Thu, 28 Feb 2013 15:13:48 +0000 (15:13 +0000)]
heat tools : openstack script install mysql via openstack-db
Don't install mysql-server in tools/openstack, instead allow
openstack-db to non-interactively install it for us, which means
the root password is set as per the -r password option when
installing on a fresh system with no mysql
NOTE : if testing this on a system which has had mysql installed,
do yum remove mysql-server && rm -fr /var/lib/mysql or the
reinstalled mysql will use the old credentials
Steven Hardy [Tue, 26 Feb 2013 14:20:00 +0000 (14:20 +0000)]
heat engine : loadbalancer resource template, refer to StackId
Use the new AWS::StackId pseudo parameter to refer to the stack for
cfn-hup etc, otherwise the stack lookup by name will fail - using
the AWS::StackId parameter means we'll refer to the stack via the
full ARN and the CFN API will be able to lookup the nested stack.
Steven Hardy [Tue, 26 Feb 2013 14:17:00 +0000 (14:17 +0000)]
heat engine : Re-resolve resource static data before create
Re-resolve the template static data before creating the resource,
or we resolve the wrong value for the AWS::StackId pseudo parameter
which is updated after the parser.Stack gets stored.
Steven Hardy [Tue, 26 Feb 2013 14:55:18 +0000 (14:55 +0000)]
heat engine : Compare runtime resolved resource snippets on update
We need to compare the runtime resolved resource snippet, since that
is what we get back from self.parsed_template. If we don't do this,
then we get a false positive when a Ref to a parameter which gets
updated (e.g AWS::StackId) is used in the resource properties.
Steven Hardy [Mon, 25 Feb 2013 14:47:45 +0000 (14:47 +0000)]
heat engine : Add parser parameter support for AWS::StackId
Adds support for the AWS::StackId pseudo parameter, which will
allow us to to reference the stack ARN in the template, e.g so that
stacks can query their resource metadata via ARN not stack name,
which will solve the problem with nested resource being unable
to query their metadata.
Steven Hardy [Mon, 25 Feb 2013 11:19:19 +0000 (11:19 +0000)]
Add waitcondition to loadbalancer nested template
We want to ensure the LB instance has fully launched before declaring
this resource created, otherwise the resource will not be functional
and attempts to modify config via metadata updates will fail
Steven Hardy [Tue, 26 Feb 2013 16:34:28 +0000 (16:34 +0000)]
heat engine : fix variable/import shadowing in service.py
The resources import is shadowed by a variable declaration in
validate template, which is confusing, so add a prefix to
differentiate the variable from the import
Steven Hardy [Tue, 26 Feb 2013 16:31:12 +0000 (16:31 +0000)]
heat engine : reinstate resources import
Reinstate the resources import removed by 06f4f85, without this
we fail to create any resources (GenericResource is created for
all resources due to no resource plugins being imported).
Angus Salkeld [Mon, 25 Feb 2013 00:44:19 +0000 (11:44 +1100)]
Update the metadata if an alarm action makes changes
The point of this change?
- You have another instances' ip in your metadata and if it
gets restarted you want cfn-hup to see the new ip.
How is it achieved?
- poll for the metadata so you can see these changes (cfn-hup)
- when ever an alarm action is run we make sure the metadata is refreshed.