Commit Graph

55 Commits

Author SHA1 Message Date
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 8d2d165755 Merge "Pagination support for server list API" 2017-10-28 16:55:05 +00: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
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 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
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
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
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
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
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 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 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
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
Jenkins ee0c05e23e Merge "Clean up unneeded server=True in model_query" 2017-07-12 10:24:03 +00:00
Zhenguo Niu d18afdeab1 Trivial-Fix: Correct KeypairExists exception message
Change-Id: I4985e8a64115f2632ddcadca79580192ab37de39
2017-07-12 13:26:39 +08:00
Zhenguo Niu fbbcfdbd0e Clean up unneeded server=True in model_query
We have removed that parameter support in model_query.

Change-Id: Ibf16abc241acf9e9e2202dbe79b71331916875f9
2017-07-12 11:33:36 +08:00
Tao Li 4e34d886b9 Fix reverting the network when plug vif failed
Currently, the port is not removed correctly when plug vif failed,
So we should fix it.

Change-Id: I095f0c3cc8fa281beb494a19f25cc20774df21f2
Closes-Bug: #1700437
2017-07-10 15:40:55 +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 4210266c28 Revert "New flavor"
This reverts commit aecfc71fdd.

Change-Id: Idbc41b50a9dede2bb99b1a882d5c19677ada4f2a
2017-06-16 23:09:38 +00: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 36c0f7586f Merge "Cleanup/keep remaining info when execute rescheduler task" 2017-05-19 02:21:47 +00:00
ZhongLuyao 433b1afcc8 Cleanup/keep remaining info when execute rescheduler task
When create a baremetal server, it will trigger rescheduler task if failure.
But it will not clearup some remaining info in the previous create_server
taskflow, such as network_info of the server. And server.node_uuid will be
cleaned if not do rescheduler, which we don't expect.

Change-Id: I25ab763ec8dd6b1ddaf66132216f285cfd73d1c1
Closes-Bug: #1691311
2017-05-18 13:59:04 +08:00
Zhenguo Niu aecfc71fdd New flavor
This adds cpus, memory, nics, and disks properties to flavors.

Change-Id: I8e7629c857dbb5164d596bf8e72f21e9d4bfcaba
2017-05-11 19:48:08 +08:00
Zhenguo Niu 5ae6a6972d Add private flavor filter for access
Change-Id: I4cb561f1b4cfc9ee1744f28e3682270bffb10f97
2017-05-02 10:01:38 +00: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
Zhenguo Niu 6dd992f367 Fix exception message format error
Change-Id: Ia3df660fcba4c50c27a38388fbc65a4d6fbed262
2017-04-17 14:32:20 +08:00
Zhenguo Niu 2c68d96cde Delete faults before destroy instances
It will raise DB error if not clean up the instance faults before,
as there's a foreign key.

Change-Id: Ie4fd84f27b1a5a7996028af7da5f0c62d2b3a5ad
2017-04-01 12:53:01 +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
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 7473e2760c Remove soft-delete for instances
There was widespread agreement to not soft-delete any more, so
we should not keep this.

Change-Id: Ia7d4daa46aa669a9b7ddf14c2f6df500b5a317ba
2017-03-22 20:40:08 +08:00
Zhenguo Niu dc6772c6f5 Change to use db resources for scheduling
This removes nodes cache and turn to use resources saved in DB.
A following up patch will split scheduler out from engine service.

Change-Id: I89dea92b85ce7055accd3658aabe3a168ebe2df5
2017-03-20 14:12: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 20fd002744 Merge "Quota support in Mogan(part 1)" 2017-03-02 08:13:09 +00:00