Commit Graph

51 Commits

Author SHA1 Message Date
zxgao f2617cde8a Add test case for availability zone api.
Change-Id: I75d95b0a576c6320f402591b709e985feb176ed8
Closes-Bug: 1809059
2018-12-19 10:00:17 +08:00
Rui Yuan Dou 7bb91da41f Add server nic unit tests
Change-Id: I0ac7cbba90f19c133ee01b79bb2966f540d54982
Closes-Bug: #1808952
2018-12-18 17:58:23 +08:00
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
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
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
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
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
Xinran 3b026239f9 Return key name with server API
Change-Id: Ia8d7c917afc3bae04997161f8bb55c30cd196d60
Closes-Bug: #1712234
2017-08-31 09:55:16 +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
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 b69a5d5a94 Merge "Add resource aggregates filed to flavor" 2017-08-07 16:00:30 +00: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
Zhenguo Niu b17fbb9a28 Add aggregates tests
* DB unit tests
* objects unit tests
* functional tests
* tempest

Change-Id: Ifb44bad51c0541105dcec091ee734d0cbba804ca
2017-08-01 10:05:27 +00: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
ZhongLuyao f9affb75f2 Update ironic.driver.plug_vif implementation
port.update is replaced by node.vif_attach

Co-Authored-By: Xinran <xin-ran.wang@intel.com>

Closes-Bug: #1694942
Change-Id: Ie0f9043a93da2b3b8dfbc660f7575c3235f751b9
2017-07-03 03:51:47 +00:00
Zhenguo Niu 4b6df25fd8 Adds `resource_traits` field for flavors
The `resource_traits` field is intended to be used to reference
the resource qualities.

Partially Implements: bp new-flavor

Change-Id: I5fa154dbf8bc96d15c3cdd3699c671e5eccc1cdd
2017-06-24 08:38:52 +00:00
Zhenguo Niu fc005946a3 Adds `resources` field for flavors.
The `resources` field is intended to be used to reference baremetal
node resource classes and also other generic resources in the cloud
tracked by placement.

Partially Implements: bp new-flavor

Change-Id: I4e8fe15aed612e62cec96d1acad236cd0924d597
2017-06-24 16:38:34 +08:00
Jenkins e562918d4f Merge "Add `extra_specs` to flavor create JSON schema" 2017-06-19 12:21:07 +00:00
Jenkins 6fec2da0d9 Merge "Adds `disabled` field for flavors." 2017-06-19 12:09:53 +00:00
Zhenguo Niu 446df0263b Add `extra_specs` to flavor create JSON schema
We should make it possible to create flavor with extra specs.

Partially Implements: bp new-flavor

Change-Id: I424e3aa6e04a0ca0e7da2784e8ff8fe9dd5ca724
2017-06-19 14:25:03 +08: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 deb70c7a63 Change to use node resource_class
Currently, we use node_type property to link with the flavors, but
ironic node's resource_class field just want to do such thing, so
we can just change to use it instead of adding a new node property.

Change-Id: I535606ce05299037a7bd5aacdcd7869ca5f855c4
Closes-Bug: #1695819
2017-06-05 17:04:00 +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 52449d4019 Following up patch of 7d0f8ab360
It should be dbapi instance, a mistake when renaming instances to
servers.

Change-Id: I5a9ca3720c7b261737dacb2cfbb671a0849de051
2017-05-09 17:47:22 +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 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
Zhenguo Niu e173d1f432 Use DB ports instead of fetching from driver
We have saved node ports information to DB, so change to use it
instead of issuing an extra API request.

Change-Id: I5b9183a1afdcb1e9444a88dfa50e1c31bf54e805
2017-03-25 11:50:12 +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
Jenkins 84937e46c0 Merge "Add instance_fault testcases" 2017-03-21 08:34:19 +00:00
Zhong Luyao c911b3858b Add instance_fault testcases
add unit testcases
1.db testcases
2.objects testcases

Change-Id: I4cd8ce8ecb2cf2977599906e763a2742fd59f9c6
2017-03-21 14:23:16 +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 2d26f7d39e Save node resources to DB
This tries to save available nodes resources to DB, but we still
use node cache for scheduling, will add following up patches to
finish to whole refactor.

Note: This also change to use node_type from ironic node instead
of instance_type.

Change-Id: Ic43180a8c85e36ef8e04edb2b99044b1d715cbd1
2017-03-15 17:45:50 +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
wanghao b713fe2324 Quota support in Mogan(part 1)
Support quota features in Mogan.
This patch will introduce the basic concepts
of quota, including Quota, QuotaUsage, Reservation,
QuotaDriver.

Change-Id: I654b3f60880d4ab817b1b457e47882be5adca831
Implements: bp quota-support
2017-03-02 14:59:47 +08:00
liusheng a7510fb50f Split out network_info from Instance object
Change-Id: I4b56db02c07901b0019147dc5ee83e6192256435
2017-03-01 14:15:35 +08:00
zhangjl 79174c35b8 Lock instances support in Mogan(part 1)
This patch adds locked and locked_by columes to the data model
of mogan instances.

Change-Id: I12a10277a86809e5a5e89fbe81c5910f37de21fd
Partially-Implements: bp lock-instances
2017-02-08 08:22:20 +00:00
Zhenguo Niu 0dfb378480 Save power_state to instance and sync with ironic
1. add power_state to instance
2. add a periodic task to sync power state

Change-Id: Id51927bf8d72884d67a73c6370458222dc061210
2017-01-19 00:25:17 +08:00
Zhenguo Niu b28a51c904 Introduce a state machine for instance status
State Machine helps us to manage instance states transitions.

Change-Id: Ie7b7d33ea509484a98344e0a95728075d6aebe47
2017-01-16 18:52:20 +08:00