Commit Graph

58 Commits

Author SHA1 Message Date
Tao Li ea83f4711a Add db api layer for CRUD operations
Add the DB layer Operations for server tags

- set/unset server tags
- get server tags
- add/delete single tag
- check whether server tag exists

Change-Id: I2338ece8e4ae880835f6e20ef1e9e71a228a9703
Implements: blueprint server-tags-support
2017-10-19 14:33:58 +08:00
liusheng 896eed5dea Fix a typo
Change-Id: Ib6449e8ec1801eadd81f11f811b4d53e78d8eb65
2017-09-18 16:14:20 +08:00
Tao Li 26508fd131 Manage existing BMs: Part-2
Add the adopt baremetal node API.

Change-Id: I1897129930bface6a6c4a179e02d6107ff3811af
Implements: bp manage-existing-bms
2017-09-11 16:57:35 +08:00
Zhenguo Niu 028b28594f Add root disk partitions support
This adds root disk partitons support to allow users to specify
root, ephemeral, and swap size.

Implements: bp root-disk-partitions

Change-Id: I9562f39501c23579ba561f0cd4cbb8ef60674a6b
2017-09-06 17:30:25 +08:00
Zhenguo Niu dead07444c Add socat console support
This adds another serial console type socat support.

Change-Id: Ic443d050790aee2ea2e27daf165310f8e292fda7
Implements: bp socat-console
2017-08-29 17:07:23 +08:00
wanghao d577c88d4a Manage existing BMs: Part-1
This patch introduce a new API:
'GET: /manageable_servers' to list the adoptable nodes
from drivers to operators.

As a reference, now we implement api in the Ironic driver.

APIImpact

Implements: bp manage-existing-bms

Change-Id: I56340ce534c3b8d4e855a4c753ecf90a07147d29
2017-08-25 19:42:58 +08:00
Zhenguo Niu 66f6a4ee86 Do not allow to remove flavor which is still in use.
We should not delete flavors which is still used by some running
servers, as users will get confused if they can't get the details
of the server flavor.

Partially Implements: bp new-flavor

Change-Id: I2c89d1fdb5092426d14e55b723f1eeb392e3c7fe
2017-08-18 12:54:28 +00:00
Zhenguo Niu da476a99c6 Make disabled flavors not available for common users
The disabled field is intended to not allow new servers
created from that flavor, so this makes it happen.

Partially Implements: bp new-flavor

Change-Id: I7a3509cef6f5dea5c7d6eac63fbb179a9850daae
2017-08-15 03:13:39 +00:00
liusheng 3951ab3064 Add server groups db models and api
This change add ServerGroup, ServerGroupPolicy and ServerGroupMember
models, and add several basic DB interfaces.

Partially Implements: bp server-group-api-extension
Change-Id: I86e17798718fc26e1fd6a1fe1c33ee408738b6da
2017-08-09 17:00:55 +08:00
Jenkins 94ea8f2f01 Merge "Add aggregate nodes API" 2017-08-01 09:13:52 +00:00
Zhenguo Niu a637bfd38a Add aggregate nodes API
* list nodes for the specified aggregates
* add node to an aggregate
* remove node from an aggregate

Change-Id: I78ce523c7ba26860e02dcde84bcb84a6cc0c60ee
2017-07-31 11:03:28 +08:00
liusheng 1d70670dd7 Trivial-Fix: Correct KeypairExists exception name
The KeypairExists exception class has been fixed in patch[1], but then
be reverted in patch[2].

[1] https://review.openstack.org/#/c/482806/
[2] https://review.openstack.org/#/c/475971/

Change-Id: I91758f87c26a3846eb4d3b8cea93bd93c57d024c
2017-07-29 15:48:58 +08:00
Zhenguo Niu d830dc7256 Clean up some unused codes
Change-Id: I5552795255b5bfcaf125f3441d6ee7ea7359ec5d
2017-07-28 11:26:41 +08:00
Zhenguo Niu 9868e1a031 Adds aggregates DB model and API
This addes aggregates db model with migrations and the related
API.

Partially Implements: bp node-aggregate

Change-Id: I019a9a4a5483750dc42a8cbf714a9d194d37fae8
2017-07-26 10:58:10 +08:00
Zhenguo Niu 00c8ed1122 Add indexes to tables
This adds indexes to most tables, and make some changes to keep
consistency

Change-Id: I6cd2a52f927cad98d70d7af3b52951782d6b2e22
2017-07-18 05:51:20 +00:00
Jenkins ce70bceca4 Merge "Refactor exception raise by using mogan exception" 2017-07-14 11:56:14 +00:00
Xinran WANG bfecc061aa Detach interface for server
Partially Implements: bp attach-detach-interface

DocImpact
APIImpact

Co-Authored-By: Zhenguo Niu <Niu.ZGlinux@gmail.com>
Co-Authored-By: liusheng <liusheng2048@gmail.com>
Change-Id: Ib474e542a4d9c32bb15f91d0993e0f6dd990ca8a
2017-07-13 10:57:38 +00:00
wanghao ad83d1be16 Refactor exception raise by using mogan exception
Now in some process, Mogan catch the exception and
then raise a new wsme.exc.ClientSideError with an
additional http_code, but Mogan has defined the
http_code in some exception.

So we didn't need raise a new exception,
just raise the mogan exception if it has the http_code.

Change-Id: I9150301a43046af8a2e7290ccfebad8ca4118f90
Close-Bug: #1699075
2017-07-13 08:49:12 +08:00
Zhenguo Niu d18afdeab1 Trivial-Fix: Correct KeypairExists exception message
Change-Id: I4985e8a64115f2632ddcadca79580192ab37de39
2017-07-12 13:26:39 +08:00
liusheng ee3c64d77f Reporting nodes resource to placement service
This change importing placement service, report nodes resources to
placement and use it as unique nodes resource provider service for
Mogan's scheduler.

Co-Authored-By: Zhenguo Niu <Niu.ZGlinux@gmail.com>

Change-Id: I1cb91a10cfc8139687ad44167f33f45fd3c08e5c
Partially Implements: bp track-resources-using-placement
2017-07-07 01:54:19 +00:00
wanghao 99abbe590a Specify neutron port when creating servers
Now Mogan can support network_ids in request of creation servers.

This feature introduces the support for specifying the port_ids
in request body too.

Change-Id: I7f25a97da6e45f06f9ef2def68eeaf294659a932
Implements: bp specify-neutron-port-when-creating-instances
2017-06-20 09:21:19 +08:00
Jenkins 6fec2da0d9 Merge "Adds `disabled` field for flavors." 2017-06-19 12:09:53 +00:00
Zhenguo Niu 31249e4057 Revert "Add ComputeDisk object"
This reverts commit 4b3a7dc31c.

We don't have a disks notion in mogan yet, and there's not a plan for
support it in Pike release, so get rid of it in case of making users
confusion.

Change-Id: I84a4dec001e68b9ef9a597389136587d18a45e39
2017-06-19 13:06:53 +08:00
Zhenguo Niu b4ae79c2be Adds `disabled` field for flavors.
The `disabled` field is intended to be used when phasing out
flavors. In this case, a delete wouldn't work because the flavor
needs to still be available for live servers using that flavor,
but we don't want to allow *new* servers created from that flavor.

Partially Implements: bp new-flavor

Change-Id: I12713bfe13f506a0d9bb79f733b00bd637ef227b
2017-06-19 10:09:43 +08:00
Zhenguo Niu 5e7be51642 Revert "Add requested neworks check with the specified flavor"
This reverts commit 5938805af9.

As we plan to refactor the flavor and will get rid of the nics attribute
so this check will be done by scheduler filters

Change-Id: Ib916951cd2260146840b1fa7fd20aa4317bf8c01
2017-06-15 18:47:22 +08:00
Zhenguo Niu 81f9d78d05 Following up patch of 6673dbb88f
This removes flavor extra specs table and related methods,
moving extra specs to flavor table to make things simple,
as we have already changed to use flavor PATCH method to
manage such things.

Change-Id: I1fb5445b7d194b50b052b77624a70e59af547911
2017-06-14 17:25:45 +08:00
Jenkins 17a45afa72 Merge "Add requested neworks check with the specified flavor" 2017-05-27 01:33:07 +00:00
Zhenguo Niu 5938805af9 Add requested neworks check with the specified flavor
This adds check for the amount of networks and port_type with
the specified flavor.

Change-Id: Ie30e6a903b559cab862d009841ebd95c34ec3fec
2017-05-26 17:19:45 +08:00
Zhenguo Niu c81e8b8faa Following up patch of fea6689e74
Change-Id: Ia373415e352721c8df1e80eb5aa56ad94177b9ad
2017-05-22 14:14:56 +08:00
Jenkins 896ef30bf0 Merge "Attach interface for server" 2017-05-19 04:14:32 +00:00
Zhong Luyao fea6689e74 Attach interface for server
Partially Implements: bp attach-detach-interface

Change-Id: I3c852428676c19ebaeee1954c1a78e77a61eb014
2017-05-18 09:11:48 +00:00
Tao Li 69cc49d447 Update the assigned method for exception class
Use _msg_fmt instead of message to assign the exception description.
because message assignment can't log the message in subclasses.

Change-Id: I0d23895e6469bb33397b8c528e75ab41844270a6
2017-05-04 09:34:16 +08:00
liusheng 7d0f8ab360 Rename instance to server and instance type to flavor
Change-Id: I35a7fb0b4f3fa9e09f2fc2c739c0a9b39a8576ab
2017-04-28 14:23:22 +08:00
Zhenguo Niu e0ca68c562 Add flavor access management support
Change-Id: I1ffd0cbcc4b34393fd0186ccc17496c6adf1ee93
2017-04-27 16:58:24 +08:00
Zhenguo Niu 6fe3d0d43d Rename instance type exceptions to flavors
Change-Id: I731ae3a2d5490b0824d3c90fb67902b60fa8f437
2017-04-25 10:09:29 +08:00
liusheng ac0130bf0f Add keypair support
This change add keypair feature support.

Change-Id: I0ec5d625a2c5a8cc17f56fe3e2462127abb94000
2017-04-19 21:48:51 +08:00
Jenkins c1d2fa7172 Merge "Fix exception message format error" 2017-04-17 08:49:45 +00:00
Zhenguo Niu 6dd992f367 Fix exception message format error
Change-Id: Ia3df660fcba4c50c27a38388fbc65a4d6fbed262
2017-04-17 14:32:20 +08:00
Zhenguo Niu ef81b84b73 Following up patch of 80d8397bd4
This decodes the injected files.

Change-Id: I9d23cc084b8af0af621b04dd5516ad220bb69c2c
2017-04-17 12:52:55 +08:00
Zhenguo Niu c610213199 Add user_data support
We should allow users to specify user data when creating an
instance.

Change-Id: I8fcd9aa4ca091ba3435292b519a999653a6d5b19
2017-04-12 10:26:19 +08:00
Zhenguo Niu 8497848ac2 Add configdrive support - metadata
This adds some simple metadata information, following up
patches will add more capabilities

Co-Authored-By: Shaohe Feng <shaohe.feng@intel.com>

Change-Id: Idaa3ab813b5355ce44e97fa069cd7b664f8b4761
2017-04-10 09:42:21 +08:00
Zhenguo Niu 4b3a7dc31c Add ComputeDisk object
This is a general compute disk object, where we will save bare
metal disks for scheduling.

Change-Id: Ie2870cb3a3003073baed9c5713745f17918b5082
2017-03-30 17:22:04 +08:00
liusheng 51c68dd250 Add function to get the console info from ironic
This change added a function in mogan-engine to get the console info
from ironic.

Change-Id: I2b181ddfe2edcf0c7b84a1188d5042ad59886ee6
Partially-Implements: bp console-support
2017-03-29 16:25:41 +08:00
wanghao 32d9bf7a11 Remove log translations
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW 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

Co-Authored-By: lcsong <lcsong@fiberhome.com>

Change-Id: Ic95b5c1c451ce6aced0f44165d2191be1eab3e40
Closes-Bug: 1674560
2017-03-24 14:21:47 +08:00
Zhenguo Niu eb0c98e5b2 Add InstanceDeployAborted exception
Currently we raise InstanceDeployFailure even if users delete the
instance while it's in creation process, so add another exception
to handle this and ignore rechedule for such case.

Change-Id: I5cb3e456646801fad7a52364d7c2e4bf9edc2aa4
2017-03-23 16:31:10 +08:00
Zhenguo Niu 1b8cfe717e Add ComputePort object
This is a general compute port object, where we will save bare metal
ports for scheduling.

Change-Id: I9dd599830aedebb70c75846803e89a6fc0a421ae
2017-03-16 16:04:34 +08:00
Zhenguo Niu 9a327f5455 Add ComputeNode object
This is a general compute node object, where we will save bare metal
nodes.

Change-Id: I23d378626c5c412f45b4a79b45520ec8fe2eb800
2017-03-13 20:38:13 +08:00
Jenkins 25cbda4909 Merge "Add sync maintenance state periodic task" 2017-03-07 14:58:44 +00:00
Zhenguo Niu 25cfd4140d Make PortLimitExceeded inherit from OverQuota
Change-Id: Id7ef5cbc2ac762724e80b89aa803adc2c3f7f3f0
2017-03-07 16:48:06 +08:00
Zhenguo Niu 508b86f9b1 Add sync maintenance state periodic task
When ironic nodes go to maintenance state, we should move instance
to maintenance state as well.

Change-Id: Iced6535157668fb5cda9a0459272c13d3e8b3af5
2017-03-07 16:37:27 +08:00