Commit Graph

95 Commits (master)

Author SHA1 Message Date
wanghao bdbf3f81e7 Add manageable server information into system metadata
Now when Mogan manage the baremetal node from driver,
Mogan didn't know it is a managed server.
We need add this information "managed_server=True" to
system metadata for internal use.

So this patch will finish two jobs:
1. Implements the system metadata in Mogan
2. Add manageable server information into system metadata

Co-Authored-By: Xinran WANG <xin-ran.wang@intel.com>
Change-Id: I89947796e120d89ec56f8f5daeb9774cf15b6bd0
Implements: blueprint system-metadata
Closes-Bug: #1727913
2018-02-05 14:17:03 +08:00
liuluyang 1b2490bdf0 server group unit testing a bit wrong
the function of create_test_server_group should be used instead
create_test_aggregate

Change-Id: I383bc563d369144a5f918064309b73e7984b61ab
Closes-Bug: #1736331
2017-12-25 03:04:13 +00:00
Zuul fce0cb4c25 Merge "Remove 'locked' from server object" 2017-11-23 06:30:50 +00:00
Zuul a8050e3d5c Merge "Following up patch of bbbe964ff4e19232ce3dd326fbd3f04f0781f5b1" 2017-10-31 10:21:11 +00:00
Zuul 8d2d165755 Merge "Pagination support for server list API" 2017-10-28 16:55:05 +00:00
Zhenguo Niu d5d480d1e6 Following up patch of bbbe964ff4
This merges db migrations file into one, will not add new migration
scrips until we are offical.

Change-Id: Ibd70c05e42a6b8ad63f3818e385bc347b9ff8afa
2017-10-28 15:46:56 +08:00
Zhenguo Niu 448556bab0 Remove 'locked' from server object
locked_by can be used to check the lock status, there's no
need to keep locked field.

Change-Id: I3761ab710cf67d56163a39add4c51ee48f940a36
Closes-Bug: #1727944
2017-10-28 09:44:04 +08:00
Xinran 05cc14d399 Pagination support for server list API
We should support to return a list of servers according to users' requirements.
In this patch, marker, limit, sort_key and sort_dir were added in server list
API.
- marker is used to display a list of servers after marker
- limit is used to determinate the maximum number of servers to display
- sort_key is used to sort the returned server list by specified key value
- sort_dir is used to select a sort direction

DocImpact
APIImpact

Change-Id: Id70e965794c82a0a29e53d4364f65b0f39042c7c
Closes-Bug: #1726665
2017-10-26 07:40:05 +00:00
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
Tao Li bbbe964ff4 Add tag table in db and migration file
Add a new table named 'server_tags' in mogan database. and
provide a migration script to upgrade the old datbase.

Change-Id: I509d4db82d2aaa4c75ba93812ff0055eb3bd56f7
Implements: blueprint server-tags-support
2017-09-26 16:02:32 +08:00
Jenkins d45a8de43c Merge "Return node name with server API object" 2017-09-12 04:26:23 +00:00
Zhenguo Niu a4b1ee741f Return node name with server API object
Currently we support to list compute nodes and aggregate nodes
with names, but server show will return the node uuid always,
which makes the admins have to go to ironic to get the relationship
between name and uuid, so this changes to return node name.

Change-Id: I6f1e5d0f9cfe277fe952d21b38ebfe68dde4f745
Closes-Bug: #1715036
2017-09-11 19:05:09 +08:00
Zhenguo Niu 1c50ceed0b Add preserve_on_delete to server nic object
This field will indicate whether we should delete or unbind the
port during server deletion or detaching interfaces.

Change-Id: I25834a82b83806bf87b4c7006a8d33d56e2ce976
Closes-Bug: #1715040
2017-09-11 09:53:20 +08:00
Jenkins 98b7894d64 Merge "Correct db and model inconsistent" 2017-09-08 08:38:20 +00:00
Zhenguo Niu 1b03a15f28 Correct db and model inconsistent
This is detected by the mogan-dbsync autogenerate.

Change-Id: I5e310016aa0e2eb1bb4f6108905927eb48c4473f
2017-09-07 19:07:52 +08:00
Zhenguo Niu 93da16d88f Revert "Return node(name or uuid) with server instead of node_uuid"
This reverts commit 5124ae1d44.

Change-Id: I0ff6f7e22afbe8833bbc6044b8b7f5c768c9b940
2017-09-07 17:29:56 +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
Jenkins 75130665c4 Merge "Replace DbMigrationError with DBMigrationError" 2017-09-06 01:51:57 +00:00
Yaguo Zhou e13df01ef9 Replace DbMigrationError with DBMigrationError
because DbMigrationError is deprecated

Change-Id: I50fd81be7a1aecd4bc9c76a4368f41c55ccccd00
2017-09-05 23:04:47 +08:00
Zhenguo Niu 5124ae1d44 Return node(name or uuid) with server instead of node_uuid
Currently we support to list compute nodes and aggregate nodes
with names, but server show will return the node uuid always,
which make the admins have to go ironic to get the relationship
between name and uuid, so this changes to return node name.

Change-Id: Ia0e5122aa29c4de2e870c5b71c420de49530ba92
Closes-Bug: #1715036
2017-09-05 14:53:54 +08:00
Jenkins 5cd5e24a31 Merge "Return key name with server API" 2017-09-01 02:44:15 +00:00
Xinran 3b026239f9 Return key name with server API
Change-Id: Ia8d7c917afc3bae04997161f8bb55c30cd196d60
Closes-Bug: #1712234
2017-08-31 09:55:16 +00:00
liusheng 639aeceafb Use server group in scheduler
This change will allow the scheduler to select nodes with specified server
group in schedule_hints.

Partially Implements: bp support-schedule-hints
Change-Id: Idecd5e5f470eee12de0088b2332874b43f9dae52
2017-08-30 14:17:16 +08:00
Jenkins 0cfe589e43 Merge "Add missed abstractmethod decorators for db abstract layer methods" 2017-08-28 04:37:40 +00:00
Jenkins a85fe38f3d Merge "Leverage _detach_interface for destroying networks" 2017-08-28 04:34:04 +00:00
liusheng 0d05d0bab5 Add missed abstractmethod decorators for db abstract layer methods
Change-Id: I2cb63f7e7a06d1770af4ec293bf739d95bbdf179
2017-08-26 15:50:29 +08:00
Zhenguo Niu 9b6e5870a3 Leverage _detach_interface for destroying networks
During network task revert, we should unplug vifs as well.

Change-Id: I26b1ba8ffba167683613d901bcbee65fde1f4b2d
Closes-Bug: #1712511
2017-08-26 02:55:59 +00:00
liusheng 0a7e49aacc Add affinity_zone field for server object
Partially Implements: bp server-group-api-extension
Change-Id: Id118e661cace434c5a08ed28c65da70fe5bda6b0
2017-08-25 11:47:14 +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
Zhenguo Niu 7ec20fdd31 Add aggregates filters when do scheduling
We should extract resources aggregates information from flavor,
and pass it to placement with resources filters.

Partially Implements: bp node-aggregate

Change-Id: I96eeb7ab6636fa241e7d82bbddad8d70791c1f43
2017-08-11 07:24:26 +00:00
Jenkins e167ca3654 Merge "Add server groups db models and api" 2017-08-10 13:54:48 +00:00
Jenkins 676d2ab9a4 Merge "Improve resources updating process" 2017-08-10 13:43:58 +00:00
liusheng 705b471b12 Remove unused methods in common/paths and common/rpc
There some unused methods in common, need remove them.
This is refer to: I06660e5dfc9545bab3fa3fb04037de028b4d0c6a

Change-Id: Ia1dd62d27e591b75643b7d3deec0ec3c3ae42099
2017-08-10 14:52:39 +08: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
liusheng e6bd87df32 Improve resources updating process
This change ensure allocations of a rp being deleted firstly before the rp
deleted. And this change also avoid updating the inventory of a rp if the
rp(node) has already been consumed.

Change-Id: I507176834f8247d112c8e6d969656d1a4dded6d7
2017-08-09 16:02:44 +08:00
Jenkins e7c202cf7a Merge "Fix aggregate metadata update/remove error" 2017-08-07 19:54:52 +00:00
Zhenguo Niu 977c1d23b1 Fix aggregate metadata update/remove error
* Fix a typo of orig_metadata
* Move metadata update under db session

Change-Id: I07f71d0b93ca5431d32e4e9de37456fb5b69a964
2017-08-07 11:23:47 +08:00
Zhenguo Niu 902a9ac65b Add resource aggregates filed to flavor
This addes a new aggregates field to flavor including
aggregates metadata key/value pairs. Then we can extract
resources quantitive, qualative and group informations
from flavors.

Change-Id: Ia85ff44fa9aabf2ef172c65c9ba9a3f0ce611b50
2017-08-01 10:05:53 +00:00
wanghao a7d6d054c1 Support quota for keypairs in Mogan(part-three)
Introduce the quota management in keypair creation and deletion.

Change-Id: I8241b0bfb38a9c41b564df07a7799e4bc5438c0d
Implements: blueprint quota-support
2017-07-31 10:37:34 +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
Jenkins 8202e01311 Merge "Add support for DBDeadlock handling" 2017-07-21 09:28:07 +00:00
wanghao 57bf079b60 Miss the argument in db/driver.py
Miss the filter=None in db/driver.py, quick fix it.

Change-Id: I40c8bac056c9f837f5fe970b4352bedb5a8da18d
2017-07-20 15:00:19 +08:00
Zhenguo Niu 8700ec97d0 Add support for DBDeadlock handling
Wrap all DB write operations with oslo_db decorator to retry on
deadlock.

Change-Id: Ic1dd0d0a17bf13525a87d52827756c591d693a27
2017-07-20 05:36:41 +00:00
Jenkins 041dafae06 Merge "Add filters to server list API" 2017-07-20 05:20:09 +00:00
Xinran 0563c48554 Add filters to server list API
APIImpact
DocImpact

Closes-Bug: #1697390
Change-Id: I1fd41d0e1897d0187e49cb54c7d4539ce64a70ff
2017-07-19 17:22:41 +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 ec7d5d0d69 Merge "Clean the compute_node and compute_port objects and db interfaces" 2017-07-18 05:42:11 +00:00
liusheng d194741e10 Clean the compute_node and compute_port objects and db interfaces
This change clean the compute_node and compute_port versioned object
implementation and them db interfaces, after we totally switch to use
placement, we don't need to store any node info in Mogan's db.

Partially Implements: bp track-resources-using-placement

Change-Id: I515674d17a85a77a9380a60ef918dc6dbda8ed83
2017-07-17 14:37:09 +08:00