Remove host hardware sysinv profile

The Host Hardware Profiles for creating re-usable configuration
templates for hosts are no longer maintained or supported and should be
removed from code. Including : CPU, Interface, Storage and Memory
profiles.

profile categories:

* cpu
* memory
* storage
* interfaces

topics:

* remove objects
* update models
* update documentation
* remove import/export profile apis
* remove and update unit tests
* new version script for migration upgrade

Test Plan / Failure Path:

PASS: Verify profile feature is removed on system upgrade
      without existing previous profiles.

PASS: Verify profile feature is removed on system upgrade
      with existing previous profiles.

PASS: Verify profile feature is removed on fresh install.

Regression:
PASS: Verify that the Horizon GUI remains navigable.
PASS: Verify non-affected system commands remains listed.

Story: 2009163
Task: 43159
Signed-off-by: Pablo Bovina <pablo.bovina@windriver.com>
Depends-On: https://review.opendev.org/c/starlingx/config/+/806800
Change-Id: Id828365920ce179e347acf0de5d3ed6af09efcbd
This commit is contained in:
Pablo Bovina 2021-09-08 01:29:12 -03:00
parent 914e6bc6c4
commit e535293c68
33 changed files with 291 additions and 6475 deletions

View File

@ -326,16 +326,6 @@ itemNotFound (404)
"rel": "bookmark"
}
],
"iprofile": [
{
"href": "http://10.10.10.2:6385/v1/iprofile/",
"rel": "self"
},
{
"href": "http://10.10.10.2:6385/iprofile/",
"rel": "bookmark"
}
],
"servicenodes": [
{
"href": "http://10.10.10.2:6385/v1/servicenodes/",
@ -3619,457 +3609,6 @@ This will remove from the interface the datanetwork assigned.
This operation does not accept a request body.
---------
Profiles
---------
These APIs allow the create, display and delete of host profiles. This
includes interface profiles, cpu profiles, and volume profiles. NOTE
that the same record is used in the database for both hosts and host
profiles.
********************
Lists all profiles
********************
.. rest_method:: GET /v1/iprofile
**Normal response codes**
200
**Error response codes**
computeFault (400, 500, ...), serviceUnavailable (503), badRequest (400),
unauthorized (401), forbidden (403), badMethod (405), overLimit (413),
itemNotFound (404)
**Response parameters**
.. csv-table::
:header: "Parameter", "Style", "Type", "Description"
:widths: 20, 20, 20, 60
"iprofiles (Optional)", "plain", "xsd:list", "The list of profile entities."
"recordtype (Optional)", "plain", "xsd:string", "Indicates that the record is being used for host profile rather than a host."
"hostname (Optional)", "plain", "xsd:string", "The name of the profile."
"uuid (Optional)", "plain", "csapi:UUID", "The universally unique identifier for this object."
"links (Optional)", "plain", "xsd:list", "For convenience, resources contain links to themselves. This allows a client to easily obtain rather than construct resource URIs. The following types of link relations are associated with resources: a self link containing a versioned link to the resource, and a bookmark link containing a permanent link to a resource that is appropriate for long term storage."
"created_at (Optional)", "plain", "xsd:dateTime", "The time when the object was created."
"updated_at (Optional)", "plain", "xsd:dateTime", "The time when the object was last updated."
::
{
"iprofiles": [
{
"uuid": "b6bde724-4fda-4941-ae3f-15abd3d4107b",
"recordtype": "profile",
"task": null,
"reserved": "False",
"mgmt_ip": null,
"links": [
{
"href": "http://192.168.204.2:6385/v1/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b",
"rel": "bookmark"
}
],
"personality": null,
"created_at": "2014-09-29T13:36:36.760707+00:00",
"hostname": "ifprofile-type-1",
"updated_at": null,
"id": 23,
"ihost_uuid": null,
"profiletype": null,
"location": {
},
"action": "none",
"profilename": null,
"operational": "disabled",
"administrative": "locked",
"availability": "offline",
"uptime": 0,
"mgmt_mac": null
},
{
"uuid": "85b8d979-a1d5-4b06-8666-22646d45dcdf",
"recordtype": "profile",
"task": null,
"reserved": "False",
"mgmt_ip": null,
"links": [
{
"href": "http://192.168.204.2:6385/v1/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf",
"rel": "bookmark"
}
],
"personality": null,
"created_at": "2014-09-29T13:42:40.592612+00:00",
"hostname": "ifprofile-type-2",
"updated_at": null,
"id": 24,
"ihost_uuid": null,
"profiletype": null,
"location": {
},
"action": "none",
"profilename": null,
"operational": "disabled",
"administrative": "locked",
"availability": "offline",
"uptime": 0,
"mgmt_mac": null
}
]
}
This operation does not accept a request body.
********************************************
Shows information about a specific profile
********************************************
.. rest_method:: GET /v1/iprofile/{profile_id}
**Normal response codes**
200
**Error response codes**
computeFault (400, 500, ...), serviceUnavailable (503), badRequest (400),
unauthorized (401), forbidden (403), badMethod (405), overLimit (413),
itemNotFound (404)
**Request parameters**
.. csv-table::
:header: "Parameter", "Style", "Type", "Description"
:widths: 20, 20, 20, 60
"profile_id", "URI", "csapi:UUID", "The unique identifier of an existing profile."
**Response parameters**
.. csv-table::
:header: "Parameter", "Style", "Type", "Description"
:widths: 20, 20, 20, 60
"recordtype (Optional)", "plain", "xsd:string", "Indicates that the record is being used for host profile rather than a host."
"hostname (Optional)", "plain", "xsd:string", "The name of the profile."
"ports (Optional)", "plain", "xsd:list", "Links to the ports of the profile."
"interfaces (Optional)", "plain", "xsd:list", "Links to the interfaces of the profile."
"idisks (Optional)", "plain", "xsd:list", "Links to the disks of the profile."
"partitions (Optional)", "plain", "xsd:list", "Links to the partitions of the profile."
"istors (Optional)", "plain", "xsd:list", "Links to the physical volume storage resources of the profile."
"ipvs (Optional)", "plain", "xsd:list", "Links to the physical volumes of the profile."
"ilvgs (Optional)", "plain", "xsd:list", "Links to the logical volume group storage resources of the profile."
"inodes (Optional)", "plain", "xsd:list", "Links to the NUMA Nodes of the profile."
"icpus (Optional)", "plain", "xsd:list", "Links to the logical cores (CPUs) of the profile."
"uuid (Optional)", "plain", "csapi:UUID", "The universally unique identifier for this object."
"links (Optional)", "plain", "xsd:list", "For convenience, resources contain links to themselves. This allows a client to easily obtain rather than construct resource URIs. The following types of link relations are associated with resources: a self link containing a versioned link to the resource, and a bookmark link containing a permanent link to a resource that is appropriate for long term storage."
"created_at (Optional)", "plain", "xsd:dateTime", "The time when the object was created."
"updated_at (Optional)", "plain", "xsd:dateTime", "The time when the object was last updated."
::
{
"ports" : [
{
"rel" : "self",
"href" : "http://128.224.151.244:6385/v1/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf/ports"
},
{
"rel" : "bookmark",
"href" : "http://128.224.151.244:6385/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf/ports"
}
],
"operational" : "disabled",
"imemorys" : [
{
"rel" : "self",
"href" : "http://128.224.151.244:6385/v1/ihosts/85b8d979-a1d5-4b06-8666-22646d45dcdf/imemorys"
},
{
"rel" : "bookmark",
"href" : "http://128.224.151.244:6385/ihosts/85b8d979-a1d5-4b06-8666-22646d45dcdf/imemorys"
}
],
"iinterfaces" : [
{
"rel" : "self",
"href" : "http://128.224.151.244:6385/v1/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf/iinterfaces"
},
{
"rel" : "bookmark",
"href" : "http://128.224.151.244:6385/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf/iinterfaces"
}
],
"personality" : null,
"serialId" : null,
"hostname" : "ifprofile-type-2",
"profilename" : null,
"uuid" : "85b8d979-a1d5-4b06-8666-22646d45dcdf",
"profiletype" : null,
"ihost_uuid" : null,
"created_at" : "2014-09-29T13:42:40.592612+00:00",
"availability" : "offline",
"recordtype" : "profile",
"istors" : [
{
"rel" : "self",
"href" : "http://128.224.151.244:6385/v1/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf/istors"
},
{
"rel" : "bookmark",
"href" : "http://128.224.151.244:6385/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf/istors"
}
],
"idisks" : [
{
"rel" : "self",
"href" : "http://128.224.151.244:6385/v1/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf/idisks"
},
{
"rel" : "bookmark",
"href" : "http://128.224.151.244:6385/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf/idisks"
}
],
"uptime" : 0,
"icpus" : [
{
"rel" : "self",
"href" : "http://128.224.151.244:6385/v1/ihosts/85b8d979-a1d5-4b06-8666-22646d45dcdf/icpus"
},
{
"rel" : "bookmark",
"href" : "http://128.224.151.244:6385/ihosts/85b8d979-a1d5-4b06-8666-22646d45dcdf/icpus"
}
],
"id" : 24,
"mgmt_ip" : null,
"links" : [
{
"rel" : "self",
"href" : "http://128.224.151.244:6385/v1/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf"
},
{
"rel" : "bookmark",
"href" : "http://128.224.151.244:6385/iprofile/85b8d979-a1d5-4b06-8666-22646d45dcdf"
}
],
"location" : {},
"inodes" : [
{
"rel" : "self",
"href" : "http://128.224.151.244:6385/v1/ihosts/85b8d979-a1d5-4b06-8666-22646d45dcdf/inodes"
},
{
"rel" : "bookmark",
"href" : "http://128.224.151.244:6385/ihosts/85b8d979-a1d5-4b06-8666-22646d45dcdf/inodes"
}
],
"task" : null,
"mgmt_mac" : null,
"invprovision" : null,
"administrative" : "locked",
"updated_at" : null,
"action" : "none",
"reserved" : "False"
}
This operation does not accept a request body.
*******************
Creates a profile
*******************
.. rest_method:: POST /v1/iprofile
**Normal response codes**
200
**Error response codes**
badMediaType (415)
**Request parameters**
.. csv-table::
:header: "Parameter", "Style", "Type", "Description"
:widths: 20, 20, 20, 60
"profilename (Optional)", "plain", "xsd:string", "The name for the new profile."
"profiletype (Optional)", "plain", "xsd:string", "The type of profile to be created. Valid values are: ``if``, ``cpu`` or ``stor``."
"ihost_uuid (Optional)", "plain", "csapi:UUID", "The UUID of the Host to create the profile based on."
**Response parameters**
.. csv-table::
:header: "Parameter", "Style", "Type", "Description"
:widths: 20, 20, 20, 60
"recordtype (Optional)", "plain", "xsd:string", "Indicates that the record is being used for host profile rather than a host."
"hostname (Optional)", "plain", "xsd:string", "The name of the profile."
"ports (Optional)", "plain", "xsd:list", "Links to the ports of the profile."
"interfaces (Optional)", "plain", "xsd:list", "Links to the interfaces of the profile."
"idisks (Optional)", "plain", "xsd:list", "Links to the disks of the profile."
"partitions (Optional)", "plain", "xsd:list", "Links to the partitions of the profile."
"istors (Optional)", "plain", "xsd:list", "Links to the physical volume storage resources of the profile."
"ipvs (Optional)", "plain", "xsd:list", "Links to the physical volumes of the profile."
"ilvgs (Optional)", "plain", "xsd:list", "Links to the logical volume group storage resources of the profile."
"inodes (Optional)", "plain", "xsd:list", "Links to the NUMA Nodes of the profile."
"icpus (Optional)", "plain", "xsd:list", "Links to the logical cores (CPUs) of the profile."
"uuid (Optional)", "plain", "csapi:UUID", "The universally unique identifier for this object."
"links (Optional)", "plain", "xsd:list", "For convenience, resources contain links to themselves. This allows a client to easily obtain rather than construct resource URIs. The following types of link relations are associated with resources: a self link containing a versioned link to the resource, and a bookmark link containing a permanent link to a resource that is appropriate for long term storage."
"created_at (Optional)", "plain", "xsd:dateTime", "The time when the object was created."
"updated_at (Optional)", "plain", "xsd:dateTime", "The time when the object was last updated."
::
{
"profilename": "ifprofile-type-1",
"profiletype": "if",
"ihost_uuid": "959f785b-6387-4b98-aa30-bc861061d7a1"
}
::
{
"ports": [
{
"href": "http://192.168.204.2:6385/v1/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b/ports",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b/ports",
"rel": "bookmark"
}
],
"reserved": "False",
"links": [
{
"href": "http://192.168.204.2:6385/v1/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b",
"rel": "bookmark"
}
],
"idisks": [
{
"href": "http://192.168.204.2:6385/v1/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b/idisks",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b/idisks",
"rel": "bookmark"
}
],
"availability": "offline",
"updated_at": null,
"ihost_uuid": null,
"id": 23,
"icpus": [
{
"href": "http://192.168.204.2:6385/v1/ihosts/b6bde724-4fda-4941-ae3f-15abd3d4107b/icpus",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/ihosts/b6bde724-4fda-4941-ae3f-15abd3d4107b/icpus",
"rel": "bookmark"
}
],
"uptime": 0,
"uuid": "b6bde724-4fda-4941-ae3f-15abd3d4107b",
"mgmt_ip": null,
"hostname": "ifprofile-type-1",
"istors": [
{
"href": "http://192.168.204.2:6385/v1/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b/istors",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b/istors",
"rel": "bookmark"
}
],
"operational": "disabled",
"location": {
},
"invprovision": null,
"administrative": "locked",
"personality": null,
"iinterfaces": [
{
"href": "http://192.168.204.2:6385/v1/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b/iinterfaces",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/iprofile/b6bde724-4fda-4941-ae3f-15abd3d4107b/iinterfaces",
"rel": "bookmark"
}
],
"profiletype": null,
"mgmt_mac": null,
"task": null,
"recordtype": "profile",
"created_at": "2014-09-29T13:36:36.760707+00:00",
"action": "none",
"profilename": null,
"serialId": null,
"inodes": [
{
"href": "http://192.168.204.2:6385/v1/ihosts/b6bde724-4fda-4941-ae3f-15abd3d4107b/inodes",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/ihosts/b6bde724-4fda-4941-ae3f-15abd3d4107b/inodes",
"rel": "bookmark"
}
],
"imemorys": [
{
"href": "http://192.168.204.2:6385/v1/ihosts/b6bde724-4fda-4941-ae3f-15abd3d4107b/imemorys",
"rel": "self"
},
{
"href": "http://192.168.204.2:6385/ihosts/b6bde724-4fda-4941-ae3f-15abd3d4107b/imemorys",
"rel": "bookmark"
}
]
}
****************************
Deletes a specific profile
****************************
.. rest_method:: DELETE /v1/iprofile/{profile_id}
**Normal response codes**
204
**Request parameters**
.. csv-table::
:header: "Parameter", "Style", "Type", "Description"
:widths: 20, 20, 20, 60
"profile_id", "URI", "csapi:UUID", "The unique identifier of an existing profile."
This operation does not accept a request body.
----
DNS
----

View File

@ -1,62 +0,0 @@
#!/usr/bin/env python
# Copyright (c) 2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# This script will delete hosts which recordtype is a profile.
# This is required because host hardware profiles
# for creating re-usable configuration had been removed from GUI, CLI and
# API endpoinds. Profiles created prior the upgrade should be deleted.
import psycopg2
import sys
from psycopg2.extras import RealDictCursor
from controllerconfig.common import log
LOG = log.get_logger(__name__)
def main():
action = None
from_release = None
to_release = None
arg = 1
while arg < len(sys.argv):
if arg == 1:
from_release = sys.argv[arg]
elif arg == 2:
to_release = sys.argv[arg] # noqa
elif arg == 3:
action = sys.argv[arg]
else:
print("Invalid option %s." % sys.argv[arg])
return 1
arg += 1
log.configure()
LOG.debug("%s invoked with from_release = %s to_release = %s action = %s"
% (sys.argv[0], from_release, to_release, action))
if action == "migrate":
if from_release == '21.05':
try:
delete_profile_host()
except Exception as ex:
LOG.exception(ex)
return 1
def delete_profile_host():
conn = psycopg2.connect("dbname=sysinv user=postgres")
with conn:
with conn.cursor(cursor_factory=RealDictCursor) as cur:
cur.execute("delete from i_host where recordtype='profile'")
LOG.info("Delete profile hosts completed")
if __name__ == "__main__":
sys.exit(main())

View File

@ -54,10 +54,10 @@ def reset_config_target():
conn = psycopg2.connect("dbname=sysinv user=postgres")
with conn:
with conn.cursor(cursor_factory=RealDictCursor) as cur:
cur.execute("update i_host set config_target=NULL where "
"recordtype!='profile'",)
cur.execute("update i_host set config_target=NULL",)
LOG.info("Reset host config_target completed")
if __name__ == "__main__":
sys.exit(main())

View File

@ -4,7 +4,7 @@
#
# Copyright (C) 2019 Intel Corporation
#
# Copyright (c) 2019 Wind River Systems, Inc.
# Copyright (c) 2021 Wind River Systems, Inc.
#
# lib/config
# Functions to control the configuration and operation of stx-config
@ -109,7 +109,6 @@ function cleanup_sysinv {
sudo rm -f $SYSINV_ETC_GOENABLEDD/sysinv_goenabled_check.sh
sudo rm -f $SYSINV_CONF_DIR/policy.json
sudo rm -f $SYSINV_CONF_DIR/profileSchema.xsd
sudo rm -f $SYSINV_ETC_MOTDD/10-system
sudo rm -f $SYSINV_CONF_DIR/upgrades/delete_load.sh
sudo rm -f $STX_OCF_ROOT/resource.d/platform/sysinv-api
@ -249,7 +248,6 @@ function install_sysinv {
sudo install -p -D -m 755 $SYSINV_DIR/etc/sysinv/sysinv_goenabled_check.sh $SYSINV_ETC_GOENABLEDD/sysinv_goenabled_check.sh
sudo install -d -m 755 $SYSINV_CONF_DIR
sudo install -p -D -m 755 $SYSINV_DIR/etc/sysinv/policy.json $SYSINV_CONF_DIR/policy.json
sudo install -p -D -m 640 $SYSINV_DIR/etc/sysinv/profileSchema.xsd $SYSINV_CONF_DIR/profileSchema.xsd
sudo install -d -m 755 $SYSINV_ETC_MOTDD
sudo install -p -D -m 755 $SYSINV_DIR/etc/sysinv/motd-system $SYSINV_ETC_MOTDD/10-system
sudo install -d -m 755 $SYSINV_CONF_DIR/upgrades

View File

@ -29,7 +29,6 @@ features:
- Node role and role profiles.
- Core and memory (including huge page) assignments.
- Network Interfaces and storage assignments.
- Bulk configuration of nodes through system profiles.
- |
User Interface:

View File

@ -89,7 +89,6 @@ install -p -D -m 755 etc/sysinv/sysinv_goenabled_check.sh %{buildroot}%{local_et
install -d -m 755 %{buildroot}%{local_etc_sysinv}
install -p -D -m 755 etc/sysinv/policy.json %{buildroot}%{local_etc_sysinv}/policy.json
install -p -D -m 640 etc/sysinv/profileSchema.xsd %{buildroot}%{local_etc_sysinv}/profileSchema.xsd
install -p -D -m 644 etc/sysinv/crushmap-storage-model.txt %{buildroot}%{local_etc_sysinv}/crushmap-storage-model.txt
install -p -D -m 644 etc/sysinv/crushmap-controller-model.txt %{buildroot}%{local_etc_sysinv}/crushmap-controller-model.txt

View File

@ -90,7 +90,6 @@ install -p -D -m 755 etc/sysinv/sysinv_goenabled_check.sh %{buildroot}%{local_et
install -d -m 755 %{buildroot}%{local_etc_sysinv}
install -p -D -m 644 etc/sysinv/policy.json %{buildroot}%{local_etc_sysinv}/policy.json
install -p -D -m 640 etc/sysinv/profileSchema.xsd %{buildroot}%{local_etc_sysinv}/profileSchema.xsd
install -p -D -m 644 etc/sysinv/crushmap-storage-model.txt %{buildroot}%{local_etc_sysinv}/crushmap-storage-model.txt
install -p -D -m 644 etc/sysinv/crushmap-controller-model.txt %{buildroot}%{local_etc_sysinv}/crushmap-controller-model.txt

View File

@ -1,354 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="Processor">
<xs:attribute type="xs:byte" name="index" />
<xs:attribute type="xs:byte" name="numberOfCores" />
</xs:complexType>
<xs:complexType name="CPUProfile">
<xs:sequence>
<xs:element name="processor" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:byte" name="numberOfProcessor" />
<xs:element type="xs:byte" name="coresPerProcessor" />
<xs:element type="xs:boolean" name="hyperThreading" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="platformCores" minOccurs="1">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="processor" type="Processor" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="vswitchCores" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="processor" type="Processor" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sharedCores" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="processor" type="Processor" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="required" />
</xs:complexType>
<xs:complexType name="memoryAllocation">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element name="processor" type="processorMemory" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="processorMemory">
<xs:attribute type="xs:nonNegativeInteger" name="index" use="required" />
<xs:attribute type="xs:nonNegativeInteger" name="size" use="required" />
</xs:complexType>
<xs:complexType name="MemoryProfile">
<xs:sequence>
<xs:element type="xs:byte" name="numberOfProcessor" />
<xs:element name="platformReservedMiB" type="memoryAllocation" minOccurs="0" maxOccurs="1"/>
<xs:element name="vmHugePages2M" type="memoryAllocation" minOccurs="0" maxOccurs="1"/>
<xs:element name="vmHugePages1G" type="memoryAllocation" minOccurs="0" maxOccurs="1"/>
<xs:element name="vsHugePagesNr" type="memoryAllocation" minOccurs="0" maxOccurs="1"/>
<xs:element name="vsHugePagesSz" type="memoryAllocation" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="required" />
</xs:complexType>
<xs:simpleType name="TxPolicy">
<xs:restriction base="xs:string">
<xs:enumeration value="layer3+4" />
<xs:enumeration value="layer2+3" />
<xs:enumeration value="layer2" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="AeModePolicy">
<xs:attribute name="txPolicy" type="TxPolicy" />
</xs:complexType>
<xs:complexType name="AeMode">
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="activeStandby" />
<xs:element name="balanced" type="AeModePolicy" />
<xs:element name="ieee802.3ad" type="AeModePolicy" />
</xs:choice>
</xs:complexType>
<xs:simpleType name="Ipv4Mode">
<xs:restriction base="xs:string">
<xs:enumeration value="disabled" />
<xs:enumeration value="static" />
<xs:enumeration value="dhcp" />
<xs:enumeration value="pool" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="Ipv6Mode">
<xs:restriction base="xs:string">
<xs:enumeration value="disabled" />
<xs:enumeration value="static" />
<xs:enumeration value="auto" />
<xs:enumeration value="link-local" />
<xs:enumeration value="pool" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="interface">
<xs:attribute name="name" type="xs:string" use="required" />
</xs:complexType>
<xs:complexType name="interfaces">
<xs:sequence minOccurs="1" maxOccurs="unbounded">
<xs:element type="interface" name="interface" >
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="providerNetwork">
<xs:attribute name="name" type="xs:string" use="required" />
</xs:complexType>
<xs:complexType name="providerNetworks">
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:element type="providerNetwork" name="providerNetwork" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="IpPool">
<xs:attribute name="name" use="required">
</xs:attribute>
</xs:complexType>
<xs:complexType name="ipv4">
<xs:sequence>
<xs:element name="pool" type="IpPool" minOccurs="0" maxOccurs="1">
</xs:element>
</xs:sequence>
<xs:attribute name="mode" type="Ipv4Mode" use="required" />
</xs:complexType>
<xs:complexType name="ipv6">
<xs:sequence>
<xs:element name="pool" type="IpPool" minOccurs="0" maxOccurs="1">
</xs:element>
</xs:sequence>
<xs:attribute name="mode" type="Ipv6Mode" use="required" />
</xs:complexType>
<xs:complexType name="dataclassNetwork">
<xs:sequence>
<xs:element name="providerNetworks" type="providerNetworks" minOccurs="1" maxOccurs="unbounded">
</xs:element>
<xs:element name="ipv4" type="ipv4" minOccurs="1" maxOccurs="1">
</xs:element>
<xs:element name="ipv6" type="ipv6" minOccurs="1" maxOccurs="1">
</xs:element>
<xs:element name="routes" type="routes" minOccurs="0" maxOccurs="1">
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="externalNetwork">
</xs:complexType>
<xs:complexType name="pciPassthrough">
<xs:sequence>
<xs:element name="providerNetworks" type="providerNetworks" minOccurs="1" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="pciSriov">
<xs:sequence>
<xs:element name="providerNetworks" type="providerNetworks" minOccurs="1" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
<xs:attribute name="virtualFunctions" type="xs:nonNegativeInteger" use="required" />
<xs:attribute name="virtualFunctionDriver" type="xs:string" />
<xs:attribute name="maxTxRate" type="xs:nonNegativeInteger" />
</xs:complexType>
<xs:complexType name="route">
<xs:attribute name="network" type="xs:string" />
<xs:attribute name="metric" type="xs:integer" />
<xs:attribute name="gateway" type="xs:string" />
</xs:complexType>
<xs:complexType name="routes">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="route" type="route">
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="pciAddress">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-fA-F]{1,4}[:][0-9a-fA-F]{1,2}[:][0-9a-fA-F]{1,2}[.][0-9a-fA-F]" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="pciClass">
<xs:restriction base="xs:string">
<xs:enumeration value="Ethernet controller" />
<xs:enumeration value="Network controller" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ethernetInterface">
<xs:sequence>
<xs:element name="port" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:attribute name="name" use="optional" />
<xs:attribute name="pciAddress" type="pciAddress" use="optional" />
<xs:attribute name="class" type="pciClass" use="required" />
<xs:attribute name="device" use="required" />
</xs:complexType>
</xs:element>
<xs:element name="networks" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="2">
<xs:element name="dataclassNetwork" type="dataclassNetwork" maxOccurs="1">
</xs:element>
<xs:element name="clusterhostNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
<xs:element name="mgmtNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
<xs:element name="oamNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
<xs:element name="pciPassthrough" type="pciPassthrough" maxOccurs="1">
</xs:element>
<xs:element name="pciSriov" type="pciSriov" maxOccurs="1">
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ifName" type="xs:string" use="required" />
<xs:attribute name="mtu" type="xs:positiveInteger" use="required" />
</xs:complexType>
<xs:simpleType name="VlanId">
<xs:restriction base="xs:short">
<xs:minInclusive value="1" />
<xs:maxInclusive value="4094" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="vlanInterface">
<xs:sequence>
<xs:element name="networks">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="2">
<xs:element name="mgmtNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
<xs:element name="oamNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
<xs:element name="dataclassNetwork" type="dataclassNetwork" maxOccurs="1">
</xs:element>
<xs:element name="clusterhostNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ifName" type="xs:string" use="required" />
<xs:attribute name="interface" type="xs:string" use="required" />
<xs:attribute name="vlanId" type="VlanId" use="required"/>
<xs:attribute name="mtu" type="xs:positiveInteger" use="required" />
</xs:complexType>
<xs:complexType name="aeInterface">
<xs:sequence>
<xs:element name="networks" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="2">
<xs:element name="mgmtNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
<xs:element name="oamNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
<xs:element name="dataclassNetwork" type="dataclassNetwork" maxOccurs="1">
</xs:element>
<xs:element name="clusterhostNetwork" type="externalNetwork" maxOccurs="1">
</xs:element>
</xs:choice>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="interfaces" type="interfaces">
</xs:element>
<xs:element name="aeMode" type="AeMode" minOccurs="1" maxOccurs="1">
</xs:element>
</xs:sequence>
<xs:attribute name="ifName" type="xs:string" use="required" />
<xs:attribute name="mtu" type="xs:positiveInteger" use="required" />
</xs:complexType>
<xs:complexType name="InterfaceProfile">
<xs:choice maxOccurs="unbounded">
<xs:element type="ethernetInterface" name="ethernetInterface">
</xs:element>
<xs:element type="vlanInterface" name="vlanInterface">
</xs:element>
<xs:element type="aeInterface" name="aeInterface">
</xs:element>
</xs:choice>
<xs:attribute type="xs:string" name="name" use="required" />
</xs:complexType>
<xs:simpleType name="volumeFunction">
<xs:restriction base="xs:string">
<xs:enumeration value="osd" />
<xs:enumeration value="journal" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Disk">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="path" use="required" />
<xs:attribute type="xs:positiveInteger" name="size" use="required" />
<xs:attribute type="volumeFunction" name="volumeFunc" use="optional" />
<xs:attribute type="xs:positiveInteger" name="journalSize" use="optional" />
<xs:attribute type="xs:string" name="journalLocation" use="optional" />
<xs:attribute type="xs:string" name="tier" use="optional" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="StorageProfile">
<xs:sequence maxOccurs="unbounded">
<xs:element type="Disk" name="disk" minOccurs="0" />
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="required" />
</xs:complexType>
<xs:simpleType name="Lvm_vg_name">
<xs:restriction base="xs:string">
<xs:enumeration value="nova-local" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Lvg">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="Lvm_vg_name" name="lvm_vg_name" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="LocalStorageProfile">
<xs:sequence maxOccurs="unbounded">
<xs:element type="Disk" name="disk" minOccurs="0" />
<xs:element type="Lvg" name="lvg" minOccurs="0" />
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="required" />
</xs:complexType>
<xs:element name="profiles">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="cpuProfile" type="CPUProfile" maxOccurs="unbounded" minOccurs="0" nillable="true" />
<xs:element name="memoryProfile" type="MemoryProfile" maxOccurs="unbounded" minOccurs="0" nillable="true" />
<xs:element name="interfaceProfile" type="InterfaceProfile" maxOccurs="unbounded" minOccurs="0" nillable="true" />
<xs:element name="storageProfile" type="StorageProfile" maxOccurs="unbounded" minOccurs="0" nillable="true" />
<xs:element name="localstorageProfile" type="LocalStorageProfile" maxOccurs="unbounded" minOccurs="0" nillable="true" />
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@ -1,339 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<profiles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="profileSchema.xsd">
<!--This is a typical 2 processors by 10 physical cores compute node
Taken from HP380 -->
<cpuProfile name="cpu-2x10">
<processor>
<!--number of processors on the server-->
<numberOfProcessor>2</numberOfProcessor>
<!--number of physical cores in each processor.
Specify number of the physical cores here.
To see logical core mapping, turn on the hyper-threading below-->
<coresPerProcessor>10</coresPerProcessor>
<!--use optional hyperThreading to enable hyper-thread to the -->
<!--profile. Enabling hyper-threading will make the profile looks-->
<!--like what it is as if the host has it hyper-threading enabled. -->
<hyperThreading>false</hyperThreading>
</processor>
<!--platformCores section defines physical cores assign to platform functions on each processor -->
<platformCores>
<!--Each processor tag defines number of physical cores to be assigned to platform function on
a processor indicated by the index.
processor index starts from 0 to numberOfProcessor -1.
Each processor (indicated by index) should only appear once-->
<processor index="0" numberOfCores="1"></processor>
</platformCores>
<!--vswitchCores section defines physical cores assign to vswitch functions on each processor
This setting only apply to the compute nodes. -->
<vswitchCores>
<!--Each processor tag defines number of physical cores to be assigned to vswitch function on
a processor indicated by the index.
processor index starts from 0 to numberOfProcessor -1.
Each processor (indicated by index) should only appear once-->
<processor index="0" numberOfCores="2"></processor>
</vswitchCores>
<!--remaining cores on each processor are assigned to guest VMs-->
</cpuProfile>
<!--this setup is taken from HP380 -->
<memoryProfile name="mem-profile">
<!--number of CPUs on the motherboard-->
<numberOfProcessor>2</numberOfProcessor>
<!--platformReservedMiB section defines the memory to be reserved for platform functions-->
<platformReservedMiB>
<!--Each processor tag defines number of physical cores to be assigned to vswitch function on
a processor indicated by the index.
processor index starts from 0 to numberOfProcessor -1.
Each processor (indicated by index) should only appear once.
The size is in MB-->
<processor index="0" size="4000"></processor>
<processor index="1" size="2000"></processor>
</platformReservedMiB>
<!--vmHugePages2M section defines number of 2M bytes huge page assigned to each processor-->
<vmHugePages2M>
<!--Each processor tag defines number of physical cores to be assigned to vswitch function on
a processor indicated by the index.
processor index starts from 0 to numberOfProcessor -1.
Each processor (indicated by index) should only appear once. -->
<processor index="0" size="29096"></processor>
<processor index="1" size="30129"></processor>
</vmHugePages2M>
<!--vmHugePages1G section defines number of 1G bytes huge page assigned to each processor-->
<vmHugePages1G>
<!--Each processor tag defines number of physical cores to be assigned to vswitch function on
a processor indicated by the index.
processor index starts from 0 to numberOfProcessor -1.
Each processor (indicated by index) should only appear once. -->
<processor index="0" size="0"></processor>
<processor index="1" size="0"></processor>
</vmHugePages1G>
</memoryProfile>
<!--This setup is taken from wildcat7_12-->
<storageProfile name="storage-profile">
<!--The disk tags below define each device,
path: device path
size: minimum size (in GiB)
volumeFunc: volume function to be assigned to the device
For 'osd' function:
journalSize: the size of the ceph journal in GiB, if absent defaults to journal_default_size in sysinv.conf
journalLocation: location of the journal partition, mandatory if multiple journal functions are defined,
if absent defaults to the single available journal drive.
If no device with journal function is configured then the journals for all OSDs will be collocated on the
same device with the OSD data (partition #1 is for the data and partition #2 for the journl).
In this case the size of the journal will be journal_default_size.-->
<disk path="/dev/sdb" size="223" volumeFunc="osd" journalSize="2" journalLocation="/dev/sdd" />
<disk path="/dev/sdc" size="223" volumeFunc="osd" journalLocation="/dev/sde" />
<disk path="/dev/sdd" size="223" volumeFunc="journal" />
<disk path="/dev/sde" size="223" volumeFunc="journal" />
</storageProfile>
<storageProfile name="storage-profile-coloc-no-tier">
<!--The disk tags below define each device,
path: device path
size: minimum size (in GiB)
volumeFunc: volume function to be assigned to the device
For 'osd' function:
journalSize: the size of the ceph journal in GiB, if absent defaults to journal_default_size in sysinv.conf
journalLocation: location of the journal partition, mandatory if multiple journal functions are defined,
if absent defaults to the single available journal drive.
tier: storage tier for OSDs. If this is not specified, then the
primary system default tier, 'storage', is used.
If no device with journal function is configured then the journals for all OSDs will be collocated on the
same device with the OSD data (partition #1 is for the data and partition #2 for the journl).
In this case the size of the journal will be journal_default_size.
-->
<disk path="/dev/disk/by-path/pci-0000:00:0d.0-ata-2.0" size="50" volumeFunc="osd"/>
<disk path="/dev/disk/by-path/pci-0000:00:0d.0-ata-3.0" size="50" volumeFunc="osd"/>
</storageProfile>
<storageProfile name="storage-profile-journal-no-tier">
<!--The disk tags below define each device,
path: device path
size: minimum size (in GiB)
volumeFunc: volume function to be assigned to the device
For 'osd' function:
journalSize: the size of the ceph journal in GiB, if absent defaults to journal_default_size in sysinv.conf
journalLocation: location of the journal partition, mandatory if multiple journal functions are defined,
if absent defaults to the single available journal drive.
tier: storage tier for OSDs. If this is not specified, then the
primary system default tier, 'storage', is used.
If no device with journal function is configured then the journals for all OSDs will be collocated on the
same device with the OSD data (partition #1 is for the data and partition #2 for the journl).
In this case the size of the journal will be journal_default_size.
-->
<disk path="/dev/disk/by-path/pci-0000:00:0d.0-ata-2.0" size="50" volumeFunc="osd"/>
<disk path="/dev/disk/by-path/pci-0000:00:0d.0-ata-3.0" size="50" volumeFunc="journal"/>
</storageProfile>
<storageProfile name="storage-profile-coloc-two-tiers">
<!--The disk tags below define each device,
path: device path
size: minimum size (in GiB)
volumeFunc: volume function to be assigned to the device
For 'osd' function:
journalSize: the size of the ceph journal in GiB, if absent defaults to journal_default_size in sysinv.conf
journalLocation: location of the journal partition, mandatory if multiple journal functions are defined,
if absent defaults to the single available journal drive.
tier: storage tier for OSDs. If this is not specified, then the
primary system default tier, 'storage', is used.
If no device with journal function is configured then the journals for all OSDs will be collocated on the
same device with the OSD data (partition #1 is for the data and partition #2 for the journl).
In this case the size of the journal will be journal_default_size.
-->
<disk path="/dev/disk/by-path/pci-0000:00:0d.0-ata-2.0" size="50" volumeFunc="osd" tier="storage"/>
<disk path="/dev/disk/by-path/pci-0000:00:0d.0-ata-3.0" size="50" volumeFunc="osd" tier="gold"/>
</storageProfile>
<localstorageProfile name="localstorage-profile_localimage">
<!--The disk tags below define each device,
node: device node
size: minimum size (in GiB).
The lvg tags below define the local volume group
lvm_vg_name: local volume group name
-->
<disk path="/dev/sdb" size="223" />
<lvg lvm_vg_name="nova-local" />
</localstorageProfile>
<localstorageProfile name="localstorage-profile_remote">
<!--The disk tags below define each device,
node: device node
size: minimum size (in MB).
The lvg tags below define the local volume group
lvm_vg_name: local volume group name
-->
<disk path="/dev/sdb" size="223" />
<lvg lvm_vg_name="nova-local" />
</localstorageProfile>
<interfaceProfile name="if-hp380-profile">
<!--This is a typical Ethernet interface definition.
It defines:
'ifName', name of the interface
'mtu', mtu of the interface, and
Ethernet port associated to this Ethernet interface (see port section below)
-->
<ethernetInterface ifName="eth0" mtu="1500" >
<!--An Ethernet port is identified by its class, device and pciAddress in order to match to a physical
Ethernet port on a host when the profile is applied to it.
Alternatively, port name can be chosen as a replacement of pciAddress.
Note that the pciAddress is directly associated with the hardware, it is the recommended identifier.
Each Ethernet port must have its pciAddress unless Ethernet port name is chosen for the matching,
in which case each Ethernet port must have its name defined.
If both pciAddress and port name are provided for each Ethernet port, only pciAddress will be used
for matching the physical Ethernet port when the profile is applied to a host.
name: Ethernet port name
pciAddress: pci address of the Ethernet port, formed in 4 section of hexadecimal digits as:
XXXX:XX:XX.X
note: each 'X' represents a hexadecimal digit.
class: pci class, valid values are:
Ethernet controller
Network controller
device: name of the device
-->
<port name="eth0" pciAddress="0000:03:00.0" class="Ethernet controller" device="NetXtreme BCM5719 Gigabit Ethernet PCIe" />
</ethernetInterface>
<ethernetInterface ifName="data0" mtu="1500" >
<port name="eth1" pciAddress="0000:03:00.1" class="Ethernet controller" device="NetXtreme BCM5719 Gigabit Ethernet PCIe" />
<!--An ethInterface can be used as data, cluster-host, oam, mgmt, pci-passthrough or pci-sriov networks. Network
type can be specified by adding the network type in the networks section.
An ethInterface can also be setup as combination of 2 network types. Only mgmt and cluster-host network can
be combined.
-->
<networks>
<dataclassNetwork>
<!--one or more provider network is required for a dataclassNetwork-->
<providerNetworks>
<providerNetwork name="group0-data0" />
<providerNetwork name="group0-data0b" />
</providerNetworks>
<!--specify ipv4 address mode, valid values are:
disabled,
pool,
dhcp, and
static-->
<ipv4 mode="disabled"></ipv4>
<!--specify ipv4 address mode, valid values are:
automaticAssignment
disabled,
pool,
linkLocal, and
static-->
<ipv6 mode="link-local"></ipv6>
</dataclassNetwork>
</networks>
</ethernetInterface>
<ethernetInterface ifName="eth2" mtu="1500" >
<port name="eth2" pciAddress="0000:03:00.2" class="Ethernet controller" device="NetXtreme BCM5719 Gigabit Ethernet PCIe" />
</ethernetInterface>
<ethernetInterface ifName="passthrough-0" mtu="1500" >
<!--This ethernetInterface is defined as pci-passthrough network. See networks section-->
<port name="eth3" pciAddress="0000:03:00.3" class="Ethernet controller" device="NetXtreme BCM5719 Gigabit Ethernet PCIe" />
<networks>
<pciPassthrough>
<providerNetworks>
<providerNetwork name="data1" />
</providerNetworks>
</pciPassthrough>
</networks>
</ethernetInterface>
<ethernetInterface ifName="eth4" mtu="1600" >
<!--This ethernetInterface is defined as pci-sriov network. See networks section-->
<port name="eth4" pciAddress="0000:04:00.0" class="Ethernet controller" device="82599ES 10-Gigabit SFI/SFP+ Network Connection" />
</ethernetInterface>
<ethernetInterface ifName="eth5" mtu="1500" >
<port name="eth5" pciAddress="0000:04:00.1" class="Ethernet controller" device="82599ES 10-Gigabit SFI/SFP+ Network Connection" />
<networks>
<mgmtNetwork/>
</networks>
</ethernetInterface>
<ethernetInterface ifName="data1" mtu="1500" >
<port name="eth6" pciAddress="0000:07:00.0" class="Ethernet controller" device="82599ES 10-Gigabit SFI/SFP+ Network Connection" />
<networks>
<dataclassNetwork>
<providerNetworks>
<providerNetwork name="group0-data1" />
</providerNetworks>
<ipv4 mode="disabled"></ipv4>
<ipv6 mode="disabled"></ipv6>
</dataclassNetwork>
</networks>
</ethernetInterface>
<ethernetInterface ifName="eth7" mtu="1500" >
<port name="eth7" pciAddress="0000:07:00.1" class="Ethernet controller" device="82599ES 10-Gigabit SFI/SFP+ Network Connection" />
</ethernetInterface>
<!--A vlan interface is defined with:
ifName, name of the vlan
interface, name of an Ethernet or an aggregrated Ethernet interface on which to run the vlan
vlanId, vlan id, valid value between 1 and 4094
mtu, mtu of the vlan interface-->
<vlanInterface ifName="cluster0" interface="eth4" vlanId="303" mtu="1500">
<!--A vlanInterface can be defined as data, cluster-host, oam, or mgmt networks by adding
the network type in the networks section.-->
<networks>
<clusterhostNetwork/>
</networks>
</vlanInterface>
<!--A aggregrated Ethernet interface is defined with:
ifName, name of the vlan
mtu, mtu of the vlan interface-->
<aeInterface ifName="ae0" mtu="1500">
<!--Aggregated Ethernet interface need to define 1 or more interfaces that it uses.
Add an interface used by this aeInterface by adding a interface section in the interfaces section,-->
<interfaces>
<!--An interface being used by the aggregrated ethernet interface. Identified by 'name'-->
<interface name="eth0"/>
<interface name="eth2" />
</interfaces>
<!--Specify one of the 3 valid aggregated Ethernet modes below-->
<aeMode>
<!--valid aggregated Ethernet mode values are:
activeStandby,
balanced, and
ieee802.3ad
txPolicy is required when ieee802.3ad or balanced is chosen. valid txPolicy values are:
layer3+4
layer2
layer2+3
-->
<ieee802.3ad txPolicy="layer3+4" />
</aeMode>
</aeInterface>
<vlanInterface ifName="vlan11" interface="ae0" vlanId="11" mtu="1600">
<networks>
<dataclassNetwork>
<!--This dataclassNetwork uses ip address pools. See ipv4 and ipv6 tag below
-->
<providerNetworks>
<providerNetwork name="group0-ext0" />
</providerNetworks>
<ipv4 mode="pool">
<!--pool needs to be specified with its name. The pool will not verified until the profile is applied
to a host.-->
<pool name="pool-1" />
</ipv4>
<ipv6 mode="pool">
<pool name="pool-2" />
</ipv6>
</dataclassNetwork>
</networks>
</vlanInterface>
</interfaceProfile>
</profiles>

View File

@ -64,7 +64,6 @@ from sysinv.api.controllers.v1 import ntp
from sysinv.api.controllers.v1 import partition
from sysinv.api.controllers.v1 import pci_device
from sysinv.api.controllers.v1 import port
from sysinv.api.controllers.v1 import profile
from sysinv.api.controllers.v1 import ptp
from sysinv.api.controllers.v1 import pv
from sysinv.api.controllers.v1 import registry_image
@ -135,9 +134,6 @@ class V1(base.APIBase):
imemory = [link.Link]
"Links to the imemory resource"
iprofile = [link.Link]
"Links to the iprofile resource"
iuser = [link.Link]
"Links to the iuser resource"
@ -348,14 +344,6 @@ class V1(base.APIBase):
bookmark=True)
]
v1.iprofile = [link.Link.make_link('self', pecan.request.host_url,
'iprofile', ''),
link.Link.make_link('bookmark',
pecan.request.host_url,
'iprofile', '',
bookmark=True)
]
v1.iinterfaces = [link.Link.make_link('self',
pecan.request.host_url,
'iinterfaces', ''),
@ -896,7 +884,6 @@ class Controller(rest.RestController):
ipvs = pv.PVController()
idisks = disk.DiskController()
partitions = partition.PartitionController()
iprofile = profile.ProfileController()
iuser = user.UserController()
idns = dns.DNSController()
intp = ntp.NTPController()

View File

@ -15,7 +15,7 @@
# License for the specific language governing permissions and limitations
# under the License.
#
# Copyright (c) 2013-2019 Wind River Systems, Inc.
# Copyright (c) 2013-2021 Wind River Systems, Inc.
#
@ -377,7 +377,6 @@ class CPUController(rest.RestController):
# only allow patching allocated_function and capabilities
# replace ihost_uuid and inode_uuid with corresponding
patch_obj = jsonpatch.JsonPatch(patch)
from_profile = False
action = None
for p in patch_obj:
if p['path'] == '/ihost_uuid':
@ -395,9 +394,6 @@ class CPUController(rest.RestController):
except exception.SysinvException:
p['value'] = None
if p['path'] == '/allocated_function':
from_profile = True
if p['path'] == '/action':
value = p['value']
patch.remove(p)
@ -428,8 +424,7 @@ class CPUController(rest.RestController):
# Semantic checks
ihost = pecan.request.dbapi.ihost_get(cpu.forihostid)
_check_host(ihost)
if not from_profile:
_check_cpu(cpu, ihost)
_check_cpu(cpu, ihost)
# Update only the fields that have changed
try:
@ -463,7 +458,7 @@ class CPUController(rest.RestController):
##############
# UTILS
##############
def _update(cpu_uuid, cpu_values, from_profile=False):
def _update(cpu_uuid, cpu_values):
# Get CPU
cpu = objects.cpu.get_by_uuid(
pecan.request.context, cpu_uuid)
@ -471,8 +466,7 @@ def _update(cpu_uuid, cpu_values, from_profile=False):
# Semantic checks
ihost = pecan.request.dbapi.ihost_get(cpu.forihostid)
_check_host(ihost)
if not from_profile:
_check_cpu(cpu, ihost)
_check_cpu(cpu, ihost)
# Update cpu
pecan.request.dbapi.icpu_update(cpu_uuid, cpu_values)

View File

@ -1,4 +1,4 @@
# Copyright (c) 2013-2020 Wind River Systems, Inc.
# Copyright (c) 2013-2021 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -26,100 +26,6 @@ VSWITCH_MIN_CORES = 0
VSWITCH_MAX_CORES = 8
class CpuProfile(object):
class CpuConfigure(object):
def __init__(self):
self.platform = 0
self.vswitch = 0
self.shared = 0
self.vms = 0
self.numa_node = 0
# cpus is a list of icpu sorted by numa_node, core and thread
# if not, provide a node list sorted by numa_node (id might not be reliable)
def __init__(self, cpus, nodes=None):
if nodes is not None:
cpus = CpuProfile.sort_cpu_by_numa_node(cpus, nodes)
cores = []
self.number_of_cpu = 0
self.cores_per_cpu = 0
self.hyper_thread = False
self.processors = []
cur_processor = None
for cpu in cpus:
key = '{0}-{1}'.format(cpu.numa_node, cpu.core)
if key not in cores:
cores.append(key)
else:
self.hyper_thread = True
continue
if cur_processor is None or cur_processor.numa_node != cpu.numa_node:
cur_processor = CpuProfile.CpuConfigure()
cur_processor.numa_node = cpu.numa_node
self.processors.append(cur_processor)
if cpu.allocated_function == constants.PLATFORM_FUNCTION:
cur_processor.platform += 1
elif cpu.allocated_function == constants.VSWITCH_FUNCTION:
cur_processor.vswitch += 1
elif cpu.allocated_function == constants.SHARED_FUNCTION:
cur_processor.shared += 1
elif cpu.allocated_function == constants.APPLICATION_FUNCTION:
cur_processor.vms += 1
self.number_of_cpu = len(self.processors)
self.cores_per_cpu = len(cores) // self.number_of_cpu
@staticmethod
def sort_cpu_by_numa_node(cpus, nodes):
newlist = []
for node in nodes:
for cpu in cpus:
if cpu.forinodeid == node.id:
cpu.numa_node = node.numa_node
newlist.append(cpu)
return newlist
class HostCpuProfile(CpuProfile):
def __init__(self, subfunctions, cpus, nodes=None):
super(HostCpuProfile, self).__init__(cpus, nodes)
self.subfunctions = subfunctions
# see if a cpu profile is applicable to this host
def profile_applicable(self, profile):
if self.number_of_cpu == profile.number_of_cpu and \
self.cores_per_cpu == profile.cores_per_cpu:
return self.check_profile_core_functions(profile)
return False # Profile is not applicable to host
def check_profile_core_functions(self, profile):
platform_cores = 0
vswitch_cores = 0
shared_cores = 0
vm_cores = 0
for cpu in profile.processors:
platform_cores += cpu.platform
vswitch_cores += cpu.vswitch
shared_cores += cpu.shared
vm_cores += cpu.vms
error_string = ""
if platform_cores == 0:
error_string = "There must be at least one core for %s." % \
constants.PLATFORM_FUNCTION
elif constants.WORKER in self.subfunctions and vswitch_cores == 0:
error_string = "There must be at least one core for %s." % \
constants.VSWITCH_FUNCTION
elif constants.WORKER in self.subfunctions and vm_cores == 0:
error_string = "There must be at least one core for %s." % \
constants.APPLICATION_FUNCTION
return error_string
def lookup_function(s):
for f in CORE_FUNCTIONS:
if s.lower() == f.lower():
@ -127,31 +33,6 @@ def lookup_function(s):
return s
def check_profile_core_functions(personality, profile):
platform_cores = 0
vswitch_cores = 0
shared_cores = 0
vm_cores = 0
for cpu in profile.processors:
platform_cores += cpu.platform
vswitch_cores += cpu.vswitch
shared_cores += cpu.shared
vm_cores += cpu.vms
error_string = ""
if platform_cores == 0:</