Skip to content

Commit

Permalink
Merge pull request #1526 from alvarosimon/one_6
Browse files Browse the repository at this point in the history
ncm-opennebula: add opennebula 6.0.x support
  • Loading branch information
wpoely86 committed Aug 16, 2023
2 parents ef5dfcb + 15f4254 commit 82ba7a1
Show file tree
Hide file tree
Showing 28 changed files with 441 additions and 63 deletions.
21 changes: 13 additions & 8 deletions ncm-opennebula/src/main/pan/components/opennebula/common.pan
Expand Up @@ -18,7 +18,7 @@ function is_consistent_database = {
req = list('server', 'port', 'user', 'passwd', 'db_name');
foreach(idx; attr; req) {
if(!exists(db[attr])) {
error(format("Invalid mysql db! Expected '%s' ", attr));
error("Invalid mysql db! Expected '%s' ", attr);
return(false);
};
};
Expand All @@ -38,15 +38,10 @@ function is_consistent_datastore = {
req = list('disk_type', 'bridge_list', 'ceph_host', 'ceph_secret', 'ceph_user', 'ceph_user_key', 'pool_name');
foreach(idx; attr; req) {
if(!exists(ds[attr])) {
error(format("Invalid ceph datastore! Expected '%s' ", attr));
error("Invalid ceph datastore! Expected '%s' ", attr);
};
};
};
if (ds['ds_mad'] == 'fs') {
if (ds['tm_mad'] != 'shared') {
error("for a fs datastore only 'shared' tm_mad is supported for the moment");
};
};
if (ds['type'] == 'SYSTEM_DS') {
if (ds['tm_mad'] == 'ceph') {
error("system datastores do not support '%s' TM_MAD", ds['tm_mad']);
Expand Down Expand Up @@ -77,7 +72,7 @@ function is_consistent_vnet = {
# if not the bridge is mandatory
} else {
if (!exists(vn['bridge'])) {
error(format("vnet with 'vn_mad' '%s' requires a 'bridge' value", vn['vn_mad']));
error("vnet with 'vn_mad' '%s' requires a 'bridge' value", vn['vn_mad']);
};
};
true;
Expand Down Expand Up @@ -153,3 +148,13 @@ type opennebula_vm = {
)
"keep_snapshots" : boolean = true
} = dict();

@documentation{
type for opennebula service common RPC attributes.
}
type opennebula_rpc_service = {
@{OpenNebula daemon RPC contact information}
"one_xmlrpc" : type_absoluteURI = 'http://localhost:2633/RPC2'
@{authentication driver to communicate with OpenNebula core}
"core_auth" : string = 'cipher' with match (SELF, '^(cipher|x509)$')
};
86 changes: 86 additions & 0 deletions ncm-opennebula/src/main/pan/components/opennebula/sched.pan
@@ -0,0 +1,86 @@
# ${license-info}
# ${developer-info}
# ${author-info}


declaration template components/opennebula/sched;

type opennebula_sched_policy_conf = {
"policy" : long(0..4) = 1
} = dict();

@documentation{
Type that sets OpenNebula scheduler
sched.conf
}
type opennebula_sched = {
include opennebula_rpc_service
@{buffer size in bytes for XML-RPC responses}
"message_size" : long = 1073741824
@{seconds to timeout XML-RPC calls to oned}
"timeout" : long = 60
@{seconds between two scheduling actions}
"sched_interval" : long = 15
@{maximum number of Virtual Machines scheduled in each scheduling
action. Use 0 to schedule all pending VMs each time}
"max_vm" : long = 5000
@{maximum number of Virtual Machines dispatched in each
scheduling action}
"max_dispatch" : long = 30
@{maximum number of Virtual Machines dispatched to each host in
each scheduling action}
"max_host" : long = 1
@{perform live (1) or cold migrations (0) when rescheduling a VM}
"live_rescheds" : long(0..1) = 0
@{type of cold migration, see documentation for one.vm.migrate
0 = save - default
1 = poweroff
2 = poweroff-hard}
"cold_migrate_mode" : long(0..2) = 0
@{this factor scales the VM usage of the system DS with
the memory size. This factor can be use to make the scheduler consider the
overhead of checkpoint files:
system_ds_usage = system_ds_usage + memory_system_ds_scale * memory}
"memory_system_ds_scale" : long = 0
@{when set (true) the NICs of a VM will be forced to be in
different Virtual Networks}
"different_vnets" : boolean = true
@{definition of the default scheduling algorithm
- policy:
0 = Packing. Heuristic that minimizes the number of hosts in use by
packing the VMs in the hosts to reduce VM fragmentation
1 = Striping. Heuristic that tries to maximize resources available for
the VMs by spreading the VMs in the hosts
2 = Load-aware. Heuristic that tries to maximize resources available for
the VMs by using those nodes with less load
3 = Custom.
- rank: Custom arithmetic expression to rank suitable hosts based in
their attributes
4 = Fixed. Hosts will be ranked according to the PRIORITY attribute found
in the Host or Cluster template}
"default_sched" : opennebula_sched_policy_conf
@{definition of the default storage scheduling algorithm
- policy:
0 = Packing. Tries to optimize storage usage by selecting the DS with
less free space
1 = Striping. Tries to optimize I/O by distributing the VMs across
datastores.
2 = Custom.
- rank: Custom arithmetic expression to rank suitable datastores based
on their attributes
3 = Fixed. Datastores will be ranked according to the PRIORITY attribute
found in the Datastore template}
"default_ds_sched" : opennebula_sched_policy_conf
@{definition of the default virtual network scheduler
- policy:
0 = Packing. Tries to pack address usage by selecting the VNET with
less free leases
1 = Striping. Tries to distribute address usage across VNETs.
2 = Custom.
- rank: Custom arithmetic expression to rank suitable datastores based
on their attributes
3 = Fixed. Virtual Networks will be ranked according to the PRIORITY
attribute found in the Virtual Network template}
"default_nic_sched" : opennebula_sched_policy_conf
"log" : opennebula_log
};
102 changes: 89 additions & 13 deletions ncm-opennebula/src/main/pan/components/opennebula/schema.pan
Expand Up @@ -11,7 +11,7 @@ include 'quattor/aii/opennebula/schema';

include 'components/opennebula/common';
include 'components/opennebula/monitord';

include 'components/opennebula/sched';

type opennebula_federation = {
"mode" : string = 'STANDALONE' with match (SELF, '^(STANDALONE|MASTER|SLAVE)$')
Expand Down Expand Up @@ -331,6 +331,17 @@ type opennebula_host = {
"Default" cluster.
Hosts can be in only one cluster at a time.}
"cluster" ? string
@{Define which Hosts are going to be used to run pinned workloads setting PIN_POLICY.
A Host can operate in two modes:
NONE: Default mode where no NUMA or hardware characteristics are considered.
Resources are assigned and balanced by an external component, e.g. numad or kernel.
PINNED: VMs are allocated and pinned to specific nodes according to different policies.
See:
https://docs.opennebula.io/6.6/management_and_operations/host_cluster_management/numa.html#configuring-the-host}
"pin_policy" ? choice('NONE', 'PINNED')
};

@documentation{
Expand Down Expand Up @@ -889,16 +900,6 @@ type opennebula_instance_types = {
"description" ? string
} = dict();

@documentation{
type for opennebula service common RPC attributes.
}
type opennebula_rpc_service = {
@{OpenNebula daemon RPC contact information}
"one_xmlrpc" : type_absoluteURI = 'http://localhost:2633/RPC2'
@{authentication driver to communicate with OpenNebula core}
"core_auth" : string = 'cipher' with match (SELF, '^(cipher|x509)$')
};

@documentation{
Type that sets the OpenNebula
sunstone_server.conf file
Expand Down Expand Up @@ -933,7 +934,7 @@ type opennebula_sunstone = {
"mode" : string = 'mixed'
"marketplace_username" ? string
"marketplace_password" ? string
"marketplace_url" : type_absoluteURI = 'http://marketplace.opennebula.systems/appliance'
"marketplace_url" : type_absoluteURI = 'http://marketplace.opennebula.io/'
"oneflow_server" : type_absoluteURI = 'http://localhost:2474/'
"instance_types" : opennebula_instance_types[] = list (
dict("name", "small-x1", "cpu", 1, "vcpu", 1, "memory", 128,
Expand All @@ -949,7 +950,10 @@ type opennebula_sunstone = {
dict("name", "large-x8", "cpu", 8, "vcpu", 8, "memory", 8192,
"description", "General purpose instance for high-load servers"),
)
"routes" : string[] = list("oneflow", "vcenter", "support")
@{List of Ruby files containing custom routes to be loaded}
"routes" : string[] = list("oneflow", "vcenter", "support", "nsx")
@{List of filesystems to offer when creating new image}
"support_fs" : string[] = list("ext4", "ext3", "ext2", "xfs")
};

@documentation{
Expand Down Expand Up @@ -990,6 +994,8 @@ type opennebula_oneflow = {
3 = DEBUG
}
"debug_level" : long(0..3) = 2
@{Endpoint for ZeroMQ subscriptions}
"subscriber_endpoint" : string = 'tcp://localhost:2101'
};

@documentation{
Expand Down Expand Up @@ -1052,6 +1058,73 @@ type opennebula_untouchables = {
"vmgroups" ? string[]
};

@documentation{
Type that sets the OpenNebula
pci.conf file
}
type opennebula_pci = {
@{
This option specifies the main filters for PCI card monitoring. The format
is the same as used by lspci to filter on PCI card by vendor:device(:class)
identification. Several filters can be added as a list, or separated
by commas. The NULL filter will retrieve all PCI cards.
From lspci help:
-d [<vendor>]:[<device>][:<class>]
Show only devices with specified vendor, device and class ID.
The ID's are given in hexadecimal and may be omitted or given
as "*", both meaning "any value"
For example:
:filter:
- '10de:*' # all NVIDIA VGA cards
- '10de:11bf' # only GK104GL [GRID K2]
- '*:10d3' # only 82574L Gigabit Network cards
- '8086::0c03' # only Intel USB controllers
or
:filter: '*:*' # all devices
or
:filter: '0:0' # no devices
No devices filter is set by default.
}
"filter" : string[] = list('0:0')
@{
The PCI cards list restricted by the :filter option above can be even more
filtered by the list of exact PCI addresses (bus:device.func).
For example:
:short_address:
- '07:00.0'
- '06:00.0'
}
"short_address" ? string[]
@{
The PCI cards list restricted by the :filter option above can be even more
filtered by matching the device name against the list of regular expression
case-insensitive patterns.
For example:
:device_name:
- 'Virtual Function'
- 'Gigabit Network'
- 'USB.*Host Controller'
- '^MegaRAID'
}
"device_name" ? string[]
@{
List of NVIDIA vendor IDs, these are used to recognize PCI devices from
NVIDIA and use vGPU feature.
For example:
:nvidia_vendors:
- '10de'
On the other hand set an empty list to use full GPU PCI PT with NVIDIA cards:
:nvidia_vendors: []
}
"nvidia_vendors" ? string[]
};

@documentation{
Type to define ONE basic resources
Expand All @@ -1073,6 +1146,9 @@ type component_opennebula = {
'sunstone' ? opennebula_sunstone
'oneflow' ? opennebula_oneflow
'kvmrc' ? opennebula_kvmrc
'sched' ? opennebula_sched
@{set pci pt filter configuration}
'pci' ? opennebula_pci
@{set vnm remote configuration}
'vnm_conf' ? opennebula_vnm_conf
@{set ssh host multiplex options}
Expand Down

0 comments on commit 82ba7a1

Please sign in to comment.