Commit Graph

29 Commits

Author SHA1 Message Date
Jeremy Freudberg ed59cfef84 Improve force delete
* Drop use of stack abandon: just use a regular delete instead
* Return stack name from force delete API call

Change-Id: I33ee7323fade1b237957abb8f7c79b87eb20148f
2018-06-12 14:20:39 -04:00
Jeremy Freudberg 6850bb8ba8 Force deletion of clusters
* Add force delete operation to engine using stack abandon
* Basic unit tests for force delete
* Necessary removal of "direct engine" code
* Change schema of APIv2 cluster delete to allow force delete
* Unit tests for new cluster delete schema
* Basic docs about force delete
* Release note

bp sahara-force-delete
Partial-Bug: #1647411

Change-Id: Ida72677c0a4110cb78edf9d62d8330cd4608ff76
2018-01-06 17:18:21 +00: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
Shu Yingya a62ac99c2c Fix instances schema doesn't sync with nova instance
Create a cluster more than 10 slave nodes, or create a cluster
named against the first half of the alphabet and scale up it
after renaming the cluster named against the second half, and
then scale down the cluster. Cluster will go to Error
"No router to host".

The root cause is that the record in instances schema doesn't
sync with nova instances. Heat deletes instances according to
the index of instances, so sahara should keep with heat to delete
the same on.

Change-Id: I05182a7f7b37a66caf45d56716f7b84a93c5c7f2
Closes-Bug: #1713012
2017-09-12 23:20:20 +08:00
lcsong 0bdd434add Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, _LW and _LC translation markers to simplify logging and to
avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

It will be a giant patch if all these _LE, _LI, _LW and _LC being deleted
within one patch, so this patch only delete _LW,  _LC and _LE has been
handled in previous patch; deletion of _LI will be in the following patches
related with this one.

Change-Id: Ia696ee76f22e488b9a219305f4f220eca2161cee
2017-04-10 16:02:05 +08: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 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 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
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 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
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 a1d7367acf Merge "Add CLUSTER_STATUS" 2015-08-15 11:03:30 +00:00
Li, Chen e1f5bcf08c Add CLUSTER_STATUS
We should define a set of CLUSTER_STATUS in stead of using direct string
in code.

1. Add cluster.py in utils/
2. Add cluster status.
3. move cluster operation related methods from general.py to cluster.py

Change-Id: Id95d982a911ab5d0f789265e03bff2256cf75856
2015-08-03 09:12:36 +08:00
Andrew Lazarev c0f8ef3090 Changed misleading function name in Heat engine
Change-Id: I9f439c14810f5bb81cefe1a8bd08feec06426fdd
Closes-Bug: #1459774
2015-07-29 22:20:27 +00: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 f4cec454ef Removed useless 'Launcher' class from heat engine
There is no sense in separate Launcher class that inherited from
Engine to have access to protected methods. This is just method
call. So, moved all class vars to arguments. Code became much
more clear.

Change-Id: I436f38cd8424158b10783c70f9ad43d49c8c2f28
Partial-Bug: #1459788
2015-07-17 14:18:59 -07:00
Jenkins c7d64c7fcd Merge "Switched Heat engine to ResourceGroup use" 2015-06-18 10:34:02 +00:00
Vitaly Gridnev 6b555829ba Move cluster deletion to common engine module
Suppose we have following scenario. I created cluster with
direct engine, after that I switched to Heat engine and removed
cluster. After that, cluster will be removed from Sahara DB,
but instances will be alive. This patch propose to add following:
if we try to delete direct-engine-created cluster with heat engine,
we will try to delete cluster in same way, like direct engine do it.

Related blueprint: deprecate-direct-engine

Change-Id: I65e22a8090560763547960213859b54b30f37f7e
2015-06-02 13:38:54 +03: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
Andrew Lazarev b558a41ff8 Hiding volumes from cluster output
Attached volumes is a technical information and should not be in
cluster output. Moreover this informatio is not used by Sahara in
most cases. Currently it is used by direct engine only to detach
volumes it attached before. After removing direct provisioning
engine "volumes" table should be removed too.

Change-Id: I10d99aed74be1126065be68082673a2e8aa1027c
Closes-Bug: #1459447
2015-05-28 12:30:17 -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
Andrey Pavlov d28ecbad4a Fixing log messages to avoid information duplication
Currently some ids in Sahara log messages are noticed twice.
All this messages should be checked and fixed to avoid information
duplication.

partially implements bp: logs-improvement

Change-Id: I1fd3f8b76ed6f56d9e8116ea453d05246a68f7dc
2015-04-22 18:44:08 +03:00
Jenkins 882328204c Merge "Switched heat engine from JSON to HOT" 2015-04-10 13:00:56 +00: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
Nikolay Starodubtsev a5ac30b63e Add new log messages where it's needed
During log rewriting process we mention some places where we should add
'Warning' and 'Info' level messages within messages we have at 'Debug'
level.

Closes-Bug: 1435208

Change-Id: Ib8bfc29c6f8c9ad5392ff09fa29a14e1209b3cc7
2015-03-23 11:54:53 +03:00
Nikolay Starodubtsev ce62f364cd Rewrite log levels and messages
This is an initial commit to make sahara logs relevant to new
logging spec.
We need to change some log levels to become closer to the spec, also
we need to change some log messages (e.g. for INFO level).

partially-implement bp new-style-logging

Change-Id: I8e7b7c4c3f375648d2999b1d0e19b68390cc22a8
2015-03-12 17:16:06 +03:00
Andrew Lazarev 954d5ba83b Changed heat engine to work with objects
Now heat engine works in a strange way. There are .heat files that
contain parts of JSON with placeholders. Placeholders are embedded
without logic. Sometimes it is just variable, sometimes JSON
key-value representation, sometimes the whole line including
trailing comma.

These .heat templates loaded by heat engine and after
placeholders replacement they are placed as strings to a large
template. These three step string manipulations are completely
non-transporent and lead to errors.

The proposed change removes .heat templates and switches heat
engine to work with objects. Resulting template is dict now.
This change removes a lot of dances with types and makes code
more straightforward.

Change was done to leave heat engine resulting template without
any changes. That's why there are unnessary type castings to
string sometimes.

The only change in output is a "userdata" field. There is no sense
in using "Fn::Join" there.

Also swapped expected and actual arguments in corresponding tests.

Related blueprint: heat-template-decomposition
Change-Id: Ib3cc152c9c3e146403eb9b52947af4c676044365
2015-03-05 13:26:00 -08:00
Andrew Lazarev c945a9886b Reorganized heat template generation code
* Extracted heat template generation from
  'utils/openstack/heat.py' to 'service/heat/templates.py'.
  Now heat.py is for heat client only.
* Moved heat template resources from 'resources' to
  'service/heat/resources'
* Separated tests for heat templates and heat client.

Change-Id: I4c7a561f1648f34e71574a556cbc07ed2cf9b173
Closes-Bug: #1373075
2015-02-18 20:56:11 +00:00