Commit Graph

53 Commits

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
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
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
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
Jenkins e167ca3654 Merge "Add server groups db models and api" 2017-08-10 13:54:48 +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
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
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 f56ad6aa2e Remove the private database config option
In both Mogan and oslo_db, there are many places directly use the 'InnoDB'
as mysql engine, we don't need to define a specific config option in
Mogan.

Change-Id: I70be7dd6767cf5f4d3122fa7255a64ab5911c9e4
2017-07-14 09:52:48 +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 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
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
liusheng 7d0f8ab360 Rename instance to server and instance type to flavor
Change-Id: I35a7fb0b4f3fa9e09f2fc2c739c0a9b39a8576ab
2017-04-28 14:23:22 +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 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
Jenkins d21df7f597 Merge "Support quota in mogan(part two)" 2017-03-30 02:14:55 +00:00
wanghao efa63af620 Support quota in mogan(part two)
This patch introduces the quota operation in
creating and deleting instances process.

Change-Id: If6573fafc5acb805cf727acdc8f0f9872fc1a717
Implements: blueprint quota-support
2017-03-29 14:46:30 +08:00
Zhenguo Niu 768a0e3b96 Don't pass sqlite_db in db_options.set_defaults()
The option sqlite_db was deprecated and removed by
Id269d921e40edf95eb977b011f1753f633b79d18

As we passed it as positional argument, another max_pool_size
var was set automatically.
This patch removes dropped sqlite_db option.

Change-Id: I81ff3c5a493958b00aa0285a680d10d7e6d7b0aa
2017-03-29 10:36:35 +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
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
Zhong Luyao 4875b5676e Add fault object
add fault object ,it is a optional object_field of instance.
if error occured, we can save related message into fault.

Change-Id: I6fb5cde7e5752683facf6ce7375c354a19cfd81a
2017-03-01 17:29:49 +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