Commit Graph

52 Commits

Author SHA1 Message Date
Jeremy Freudberg 359b89de3f Enhance boot from volume
Attached volumes already had support for explicit volume type,
availability zone, and instance locality. Extend this capability to
boot volumes.

(For posterity's sake, a summary of why other options related to
attached volumes were not in fact appropriate for boot volumes:
- volumes_per_node: there can only be one boot volume
- volumes_size: boot volume size given by flavor
- volume_mount_prefix: boot volume handled differently)

Change-Id: I009c0da4179c880fd87a7c1903c93825e8997a38
Story: 2004507
Task: 28229
2019-01-07 20:36:05 -05:00
Luigi Toscano 61b0b2e038 Bump the version of hacking to 1.1.0, with few fixes
Also switch to pycodestyle from pep8 which requires a bump
of the the version of flake8 too.

Skip the following checks for now:
- E123 Closing bracket does not match indentation of opening bracket's line
- E226 Missing whitespace around arithmetic operator
- E402 Module level import not at top of file
- E731 Do not assign a lambda expression, use a def
- W503 Line break occurred before a binary operator

They should be probably revisited and fixed, if possible,
or skipped individually using # noqa

The following checks reported a limited number of errors and
they were fixed directly in this review:
- E241 Multiple spaces after ','
- E501 Line too long (82 > 79 characters)

Change-Id: I1f185d2efd1adf27a26e3ac93f2e1011c0b63124
2018-11-26 19:03:02 +01:00
Telles Nobrega 4ac73ea6ec Fixing anti-affinity for Sahara
Sahara anti-affinity was broken since some problematic changes in
cd15698526.

This should be able to fix it.

Change-Id: I374c0340cb0f85c00b9a04cd1b23e3912737994c
Co-Authored-By: Joe Topjian <joe@topjian.net>
Story: #2002656
Task: #22466
2018-08-23 14:48:26 +00:00
Nikita Konovalov f1722350a7 Boot from volume
Adding the ability to boot a sahara cluster from volume.

Story: #2001820
Task: #12558

Change-Id: Ie11c5e7a628c369868d3c56e803da4b9e7d15f85
2018-06-15 09:25:09 -03:00
Telles Nobrega b001ef2a55 Decommission of a specific node
Adding the option to decommission specific node from cluster.

Partially implements bp: decommission-specific-instance

Change-Id: I1a858fecc1b32f91c76aea6db14e0d5a419211d1
2018-01-02 15:17:51 -03:00
zhangxuanyuan eaaa239240 Remove use_neutron from config
Nova network has been fully removed, remove use_neutron config
and related codes.

Change-Id: Ib9d87dd339d637b69fb27315d92228cbc523c8eb
Closes-Bug: #1693891
Implements: bp sahara-remove-nova-network
2017-11-24 23:27:33 +08:00
John Garbutt 88b427e988 Allow cluster create with no security groups
Got an unbound variable error without this fix:
  UnboundLocalError: local variable 'sec_groups'
  referenced before assignment

This appears to have been caused by the move to use the neutron client
in the following commit:
b4fb2c404c

Co-Authored-By: Jeremy Freudberg <jeremyfreudberg@gmail.com>
Closes-Bug: #1718940
Change-Id: I4f0b5a6b27ee2fb7821ec42faba3a69ce5a4bb78
2017-10-09 21:38:49 +00:00
Jeremy Freudberg b4fb2c404c Use neutronclient for all network operations
Latest novaclient 8.0.0 removed nova-network
related functionality which Sahara depended on for
network operations, even for Neutron.

Now, use neutronclient (and Neutron resources in
Heat) for all network operations.

Additionally, fix devstack coordination backend.

Partially-Implements: bp sahara-remove-nova-network
Closes-Bug: #1692551
Co-Authored-By: Vitaly Gridnev <vgridnev@mirantis.com>
Change-Id: I6b8e12f0d33752e7790c5f40ebe6a3940ff1b0c1
2017-06-07 13:05:16 -04:00
Akanksha Agrawal cd15698526 Improves anti-affinity behavior in sahara
Introduces a new field called anti_affinity_ratio.
Creates more server groups in case the
user defines the anti_affinity_ratio more than 1.
Default value of anti_affinity_ratio is kept 1.
Instances are placed in the server groups in round-robin
fashion.

Partially-Implements: blueprint improving-anti-affinity

Change-Id: I86bda256ea661fa0ba9d6d3819477edff080bcee
2016-10-12 09:04:37 +05:30
Michael Ionkin 64cd7566f5 Fix wait conditions with SSL deployments
This workaroud adds appropriate entries for orchestration service
in /etc/hosts file

Change-Id: Iaf1b60d4d891e90ee6259fb62654476819f93ec2
co-authored-by: Vitaly Gridnev <vgridnev@mirantis.com>
closes-bug: 1583617
2016-08-28 09:00:41 +00:00
Michael Ionkin d9a2f00d2d Designate integration
This patch implements designate integration. Added:
* 'use_designate' and 'nameservers' configs
* 'domain_name' column to Cluster and Cluster Templates and
  'dns_hostname' to Instance in DB
* get_management_ip() method for Instance for properly setup
  hostnames in cluster info and use it in ambari, cdh, mapr, spark,
  storm and vanilla plugins
* method for change /etc/resolv.conf on all cluster instances
  according to 'nameservers' config
* method for generate heat template for designate A and PTR records
* validation check for cluster template creation because now it
  contains new field - 'domain_name'
* fix unit tests appropriatly and new tests added
* updated heat_template_version to '2016-04-08' (because we use
  'str_split' method)

NOTE: in spec we proposed to use two domains: one for internal
resolution and another for external. But we decided to use only one
domain for both sides so an instance will have one hostname in the
domain and two appropriate A records because it's more convenient.

bp: designate-integration
Change-Id: I66525c0305450d8ba08840be1c95bfe79f21fff7
2016-08-02 18:53:25 +03:00
Vitaly Gridnev c8869f7ed1 don't serialize auto security group if not needed
Change-Id: I1e20fb5493e4bcf3a37a5b4a89709f55c5cdcbd6
Closes-bug: 1597482
2016-07-08 18:38:59 +03:00
Jenkins 46df5c685d Merge "Readable logging for Heat templates" 2016-06-02 18:15:56 +00:00
Mikhail Lelyakin e3e3b7ef38 Readable logging for Heat templates
Sahara used to write Heat template to log output in format
which cannot be parsed with JSON or YAML validation tools.
As a result it caused difficultis for a user to read the
initial template.

This issue is solved by making  Sahara write logs in json format.

Closes-bug: 1552239

Change-Id: Ie7a9f6fcad29899dd53fa43884e783c58ea304ec
2016-05-31 15:09:42 +03:00
Vitaly Gridnev 64355f5af5 Minimise number of auto security groups
Change-Id: Iee37425f97d6f7c35a83fe290caf76f5d0dc012e
Closes-bug: 1578850
2016-05-13 14:00:03 +00:00
Vitaly Gridnev bf09037919 Don't use precreated ports in heat templates
To have ability of creating clusters on deployments
with Ironic we should avoid using precreated ports. Now
to create floating ip we will use Nova floaiting ip
serializations.

Closes-bug: 1557066
Change-Id: I64eef2d645edf12022f686fac14cf04227eedb86
2016-03-15 11:49:24 +00:00
Vitaly Gridnev 401ac8079d rewrite wait condition script
rewriting wait condition script in the following manner:

* trying to send signal until successed, because sometimes
heat can be unavailable;

* insecure flag passed to allow wait condition work when
SSL enabled. Since this signal don't have any important
info, we can use this flag until secured way to pass certificate
will be invented.

Change-Id: I6a8003af8ae655ed49c7f93dacc8420d7d7a5054
Closes-bug: 1532766
Closes-bug: 1535274
2016-03-11 14:07:05 +03:00
Vitaly Gridnev 3002cd7ffa move heat template version to common module
actually heat template version is an important constant.
to make that same everywhere moving that to common configs.

Change-Id: I1af5147e4113eda11328a7b521c07d2b798eaaec
2016-03-01 14:00:23 +03:00
Vitaly Gridnev 8f965bfd5e Fix anti-affinity handling in heat engine
Server group is not defined inside of ResourceGroup
for node group and because of that heat can't validate
heat template. To fix that we introduced new parameter
in ResourceGroup for node group for correct id of Server
Group.

Closes-bug: 1537156
Change-Id: I133ba075fe6a989f786b1cc51ebfd126a1c2a6a9
2016-01-22 23:57:04 +03:00
Vitaly Gridnev 90587a7efb rewrite heat client calls
rewriting heat client calls logic to avoid
problems with tokens.

Closes-bug: 1486653
Change-Id: Ied6cb0755a059f64bb403769e682703306fd2152
2015-12-07 14:14:43 +03:00
Jenkins cc0e7e9c70 Merge "Enable heat_enable_wait_condition by default" 2015-11-26 12:12:35 +00:00
Jenkins c344c647f4 Merge "Add more useful information to the Heat stack description" 2015-11-25 15:08:09 +00:00
Vitaly Gridnev 33794a8627 Enable heat_enable_wait_condition by default
Set heat_enable_wait_condition to True by the default. Also
disable that in gate-sahara-dsvm-scenario-nova-heat job.

Related-bug: 1516784

Change-Id: If2e8a4ad010d516f65e2f9ae4449d70cc30d8e44
2015-11-24 13:16:57 +00:00
Jenkins 141ee549cd Merge "Option for disabling wait condition feature" 2015-11-24 02:12:03 +00:00
Sergey Lukjanov c680ded9a9 Add more useful information to the Heat stack description
Co-Authored-By: Vitaly Gridnev <vgridnev@mirantis.com>
Change-Id: Id234ff92642c8ac717217deaf9423cae0f469cfb
2015-11-20 17:56:39 +03:00
Vitaly Gridnev 7fbe557fc4 Option for disabling wait condition feature
It looks like wait condition feature works nice
but there are some issues with that on several deployments.
Added option heat_enable_wait_condition to allow disabling of that.

Closes-bug: 1516784
Change-Id: I082ce0bb4ab8c3c939dcafc2bc821e38c5d760a7
2015-11-19 07:58:03 +00:00
Vitaly Gridnev faef6379cb Remove unneeded volume serialization
It looks like this serialization introduced
because of some rebase, anyway it's clear that
it's unneeded.

Closes-bug: 1494650
Change-Id: If0140ca9f22fb3073fafccada512c877322efc2d
2015-11-19 07:57:54 +00:00
Andrey Pavlov 3bd6bee91a Fixing cluster creation without auto_security_group
If auto_security_group is disabled, but one or more
security groups is provided, cluster can't be created
and fails with yaml RepresenterError exception.

Change-Id: I294237c788c2d14d77f12e1a8d7e0dd60a6638bb
Closes-bug: #1504093
2015-10-08 17:39:16 +03:00
Jenkins 4796e5c8ee Merge "Generate random heat stack name for cluster" 2015-09-23 14:47:18 +00:00
Jenkins de856768fd Merge "Resolve issue with operating heat stack outputs" 2015-09-23 12:56:57 +00:00
Vitaly Gridnev 0b0e83ab6c Generate random heat stack name for cluster
Sahara should generate heat stack name to avoid artifical
constraint.

Change-Id: I02f7c23e19735f8f8fdecdeb858891c3ea819dc3
Closes-bug: 1495909
2015-09-23 01:41:54 +03:00
Vitaly Gridnev b4e5e12f7b Resolve issue with operating heat stack outputs
Sometimes, status of heat stack is not changed in DB
right after executing updating of heat stack. Because of
that sahara thinks that heat stack was successfully updated,
but it's wrong, because heat stack updating still in progress.

Because of that it's proposed to use field updated_time
for verification of successful update of heat stack.
We will store that field in variable, and will wait until that
will be changed.

Closes-bug: 1472536
Change-Id: Ifeee9a81ff1b37ff061de0ded371ae6f6bda4c95
2015-09-23 01:40:38 +03:00
Sergey Reshetnyak 997a184c7a Add wait condition for heat templates
Heat supports wait condition for reporting signals.
We use wait condition for getting status of VM.
If VM send signal to Heat this is means that VM booted and accessible
via SSH.

implements bp: sahara-heat-wait-conditions

Change-Id: I6f0b52840359bb46144b31fee245f0c104f1686e
2015-09-22 10:34:01 +00:00
Vitaly Gridnev 95a5fd14ef Heat stack creation with tags
Sahara should create heat stack with tags to
hide these stack from users.

Change-Id: I7656608ae4e8d24eca7eaf6e186ea3f5cbf1d02d
Closes-bug: 1495991
2015-09-21 09:39:51 +00:00
Jenkins 32bce75c8b Merge "Create ResourceGroup with volumes only if it is required" 2015-09-16 17:51:37 +00:00
Vitaly Gridnev 81370eb456 Use get_resource instead of Ref defenition
Since sahara uses HOT since liberty, we should switch on
get_resource usage in heat templates.

Change-Id: I2ba29d82654779406915311e391181926e9f59a5
Closes-bug: 1494673
2015-09-15 14:45:23 +03:00
Vitaly Gridnev 2b25dfa07f Create ResourceGroup with volumes only if it is required
If volumes_per_node or volumes_size is 0, there is no sense
in creating empty ResourceGroup.

Also remove volumes from one node group in gate to be sure
that sahara correctly handle such case.

Closes-bug: 1494650
Change-Id: Ic592710773b9338f5857e431b0567bc5c87af2bd
2015-09-15 11:42:55 +00:00
Vitaly Gridnev 92666b9c81 Remove mountpoint from heat stack because it always null
Closes-bug: 1494671
Change-Id: I631ab3276d466b8ee79eaaa35d7e791618388455
2015-09-11 09:33:45 +00:00
Jenkins 5cd46ad66b Merge "Adds IPv6 support to auto security group" 2015-09-08 18:31:17 +00:00
Kazuki OIKAWA 562ad19335 Adds IPv6 support to auto security group
Heat infra-engine uses AWS::EC2::SecurityGroup.
But AWS::EC2::SecurityGroup for Neutron doesn't support IPv6.
This patch migrate from AWS::EC2::SecurityGroup to
OS::Neutron::SecurityGroup, for Neutron.

Change-Id: I04e4aacdd843d3efa388f9527efec2e141eabbbb
Closes-Bug: #1488452
2015-09-03 17:54:16 +09:00
Sergey Lukjanov b2d74a8a44 Print Heat stack before create/update to debug logs
Change-Id: I72e3366f9933f4a8d4caac5cd11b20dcffa664ee
2015-08-29 20:16:19 +00:00
Sergey Reshetnyak 92a1b7052f Fix problem with using auto security groups in Heat
Change-Id: I95744f71770486ea2ccdc20db456702d53ae5c42
Closes-bug: #1477530
2015-08-27 19:34:18 +03:00
Andrew Lazarev 4928fd9c74 Made 'files' dict as member field of ClusterStack
Having files as member field reduces number of arguments across all
functions.

Change-Id: I7e2652796ac0f4a5abc9c74b36cb4ec55a82c55f
Partial-Bug: #1459788
2015-07-17 15:57:37 -07:00
Andrew Lazarev 4b4e6d4d22 Changed all stacks retrieval with filtered search
Filtered search is more efficient.

Change-Id: Ic29c6044b5549070580948fba4728b7f480b1f2a
2015-07-17 15:45:12 -07:00
Andrew Lazarev 3ea2e295fb Removed useless ClusterStack class from heat engine
There is no sense in having separate class to hold heat stack.

Change-Id: Idc906626743eb6686a42e87e419b96f3f5d83818
Partial-Bug: #1459788
2015-07-17 15:27:24 -07:00
Andrew Lazarev ee47f48412 Switched Heat engine to ResourceGroup use
Sahara now uses two layers of ResourceGroups:
1. Each node group is represented as ResourceGroup with specified
   count.
2. Volumes for the instance are also represented as ResourceGroup
   with a specified count.

Note: Heat creates two nested stacks for ResourceGroup (one for
nested group, other to support multiple copies). This means that
'max_nested_stack_depth' config in Heat must be at least 4.

Also, there is no sense in checking exact structure of resulting
Heat templates. But there is a sense in checking specific methods.
So, deleted all template tests and added test for security_groups.

Implements blueprint: heat-template-decomposition

Change-Id: I1bc1ea31344a2e4d624bbf2836aa51897453efe2
2015-05-29 12:44:44 -07:00
Andrey Pavlov ff98dd848f Adding retry ability to heatclient calls
All heatclient calls wrapped in execute_with_retry
method to avoid occasional errors

partially implements bp clients-calls-retry

Change-Id: I835fd79b5783f4a5271cec67b013ba8aeba3091a
2015-05-16 13:39:28 +00:00
Sergey Reshetnyak 49ba5b737f Fix usage volume type in Heat
Closes-bug: #1455471

Change-Id: I87a1ef97fe415b592771514d330fb673ceb2718a
2015-05-15 15:01:14 +03:00
Andrew Lazarev 12e5e894cc Switched heat engine from JSON to HOT
Swiftched all JSON templates to YAML templates. Since Sahara works
with objects now there are no much changes.

Implements blueprint: heat-hot
Change-Id: I2ac13e08eb4af0848f42b20b032af425d30818c7
2015-03-26 17:34:04 -07:00
Andrey Pavlov c9def918ec Added support of instance locality to engines
* added support to heat engine
* added support to direct engine
* added unit tests for heat templates

partially implements bp: volume-instance-locality

Change-Id: I9fde3967c46942c8adcbca31300e948b4d0e228e
2015-03-12 17:19:40 +03:00