-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ncm-opennebula: Open vSwitch support and VNET pools #466
Changes from 6 commits
6c71e03
6aa691f
d0b79ac
e68ef2c
8592936
b62de60
fcc5ec6
0df14c4
b315433
a8bce71
f68d247
c9b86cc
7254795
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ include 'quattor/schema'; | |
include 'pan/types'; | ||
|
||
type uuid = string with match(SELF,'[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'); | ||
type macaddr = string with match(SELF, '([0-9A-F]{2}[:-]){5}([0-9A-F]{2})'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to be different from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mmm.. no I will remove this type to use hwaddr instead |
||
|
||
type directory = string with match(SELF,'[^/]+/?$'); | ||
|
||
|
@@ -133,6 +134,19 @@ type opennebula_ceph_datastore = { | |
"rbd_format" ? long(1..2) | ||
}; | ||
|
||
@{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all the annotations must be fixed according to http://quattor-pan.readthedocs.org/en/latest/pan-book/pan-book.html#annotations. in particular, the annotation for a |
||
type for vnet ars specific attributes. | ||
type and size are mandatory | ||
@} | ||
type opennebula_ar = { | ||
"type" : string with match(SELF, "^(IP4|IP6|IP4_6|ETHER)$") | ||
"ip" ? type_ipv4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If type can be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case no, ip is always an IPv4, for IPv6 pools http://docs.opennebula.org/4.12/user/virtual_resource_management/vgg.html#vgg There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay I see, it's because their IPv6 support is only for auto-configured addresses. Worth having a validation rule to enforce this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. opennebula ignores the values that are not used, so now is quite safe and flexible but in any case I can try different possibilities in our testbed and see if we get some issue. If so yes, we can include a validation rule to be more strict with the pool definition. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Up to you, depends whether it makes it nicer to use or not. |
||
"size" : long (1..) | ||
"mac" ? macaddr | ||
"global_prefix" ? string | ||
"ula_prefix" ? string | ||
}; | ||
|
||
@{ type for an opennebula datastore. Defaults to a ceph datastore (ds_mad is ceph) @} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is backwards incompatible change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, but perhaps worth explicitly stating this in the PR text. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jrha ok, I have included a new comment into PR description to clarify this point |
||
type opennebula_datastore = { | ||
include opennebula_ceph_datastore | ||
|
@@ -147,11 +161,14 @@ type opennebula_datastore = { | |
|
||
type opennebula_vnet = { | ||
"name" : string | ||
"type" : string = 'FIXED' | ||
"bridge" : string | ||
"gateway" : type_ipv4 | ||
"dns" : type_ipv4 | ||
"network_mask" : type_ipv4 | ||
"bridge_ovs" ? string | ||
"vlan" ? boolean | ||
"vlan_id" ? long(0..4095) | ||
"ar" ? opennebula_ar | ||
}; | ||
|
||
type opennebula_user = { | ||
|
@@ -207,7 +224,7 @@ type opennebula_oned = { | |
"image_restricted_attr" : string = 'SOURCE' | ||
"inherit_datastore_attr" : string[] = list("CEPH_HOST", "CEPH_SECRET", "CEPH_USER", | ||
"RBD_FORMAT", "GLUSTER_HOST", "GLUSTER_VOLUME") | ||
"inherit_vnet_attr" : string = 'VLAN_TAGGED_ID' | ||
"inherit_vnet_attr" : string[] = list("VLAN_TAGGED_ID", "BRIDGE_OVS") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also backwards incompatible There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above, this is fine, but explicitly state this in the PR text. |
||
}; | ||
|
||
@{ | ||
|
@@ -247,6 +264,8 @@ type component_opennebula = { | |
'untouchables' : opennebula_untouchables | ||
'oned' : opennebula_oned | ||
'ssh_multiplex' : boolean = true | ||
'host_ovs' ? boolean | ||
'host_hyp' : string = 'kvm' with match (SELF, '^(kvm|xen)$') | ||
'tm_system_ds' ? string with match(SELF, "^(shared|ssh|vmfs)$") | ||
} = nlist(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,11 @@ include 'components/sudo/config'; | |
"/sbin/service libvirtd restart", | ||
"/sbin/service libvirt-guests restart", | ||
'/usr/bin/virsh secret-set-value *', | ||
'/usr/bin/virsh secret-define *' | ||
'/usr/bin/virsh secret-define *', | ||
'/usr/sbin/iptables', | ||
'/usr/sbin/ebtables', | ||
'/usr/bin/ovs-vsctl', | ||
'/usr/bin/ovs-ofctl' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add an |
||
); | ||
foreach (i; cmd; sudolist){ | ||
nl = nlist("host", "ALL", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,9 @@ prefix "/metaconfig/contents/oned"; | |
"passwd", "my-fancy-pass", | ||
"db_name", "opennebula", | ||
); | ||
"log" = nlist( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"system", "syslog", | ||
"debug_level", 3, | ||
); | ||
"default_device_prefix" = "vd"; | ||
"onegate_endpoint" = "http://hyp004.cubone.os:5030"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
object template vnet_ovsbr0; | ||
|
||
include 'components/opennebula/schema'; | ||
|
||
bind "/metaconfig/contents/vnet" = opennebula_vnet; | ||
|
||
"/metaconfig/module" = "vnet"; | ||
|
||
prefix "/metaconfig/contents/vnet"; | ||
"name" = "node3.cubone.os"; | ||
"bridge" = "br100"; | ||
"bridge_ovs" = "ovsbr0"; | ||
"gateway" = "10.141.3.250"; | ||
"dns" = "10.141.3.250"; | ||
"network_mask" = "255.255.0.0"; | ||
"vlan" = true; | ||
"vlan_id" = 0; | ||
"ar" = nlist( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"type", "IP4", | ||
"ip", "10.141.14.100", | ||
"size", 29, | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Opennebular vnet test | ||
--- | ||
multiline | ||
--- | ||
^AR\s?=\s?\[$ | ||
^\s*ip\s?=\s*".+",\s*$ | ||
^\s*size\s?=\s*".+",\s*$ | ||
^\s*type\s?=\s*".+"\s*$ | ||
^\]$ | ||
^BRIDGE\s?=\s?".+"\s*$ | ||
^BRIDGE_OVS\s?=\s?".+"\s*$ | ||
^DNS\s?=\s?".+"\s*$ | ||
^GATEWAY\s?=\s?".+"\s*$ | ||
^NAME\s?=\s?".+"\s*$ | ||
^NETWORK_MASK\s?=\s?".+"\s*$ | ||
^VLAN\s?=\s?".+"\s*$ | ||
^VLAN_ID\s?=\s?".+"\s*$ | ||
^QUATTOR\s?=\s?\d+\s*$ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
[%- booleans = ['vlan'] -%] | ||
[%- ar_section = ['ar'] -%] | ||
[% FOR pair IN vnet.pairs -%] | ||
[% pair.key.upper %] = "[% pair.value %]" | ||
[% END -%] | ||
[%- SWITCH pair.key -%] | ||
[% CASE booleans -%] | ||
[% pair.key.upper %] = "[% pair.value ? "YES" : "NO" %]" | ||
[% CASE ar_section -%] | ||
[% pair.key.upper %] = [% INCLUDE 'opennebula/oned_level1.tt' | ||
data=vnet.${pair.key} -%] | ||
[% CASE -%] | ||
[% pair.key.upper %] = "[% pair.value %]" | ||
[% END -%] | ||
[%- END -%] | ||
QUATTOR = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this generally useful enough to be added to
pan/types
instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably yes, as far as I know uuid type is used by ceph and opennebula components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's used by more than on component then I'd say yes, do you feel like opening a new PR to add it to
pan/types
and another to remove it from the components?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrha ok no prob