Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
isaak yansane-sisk
slapos
Commits
fa82cc5c
Commit
fa82cc5c
authored
Apr 24, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kvm: set additional route to reach global ipv4 network
parent
2d79471e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
slapos/recipe/softwaretype.py
slapos/recipe/softwaretype.py
+6
-0
software/kvm/common.cfg
software/kvm/common.cfg
+2
-2
software/kvm/instance-kvm.cfg.jinja2
software/kvm/instance-kvm.cfg.jinja2
+6
-1
software/kvm/instance.cfg.in
software/kvm/instance.cfg.in
+5
-0
No files found.
slapos/recipe/softwaretype.py
View file @
fa82cc5c
...
...
@@ -115,9 +115,13 @@ class Recipe:
cert_file
=
slap_connection
.
get
(
'cert_file'
)
instance_root
=
self
.
buildout
[
'buildout'
][
'directory'
]
storage_configuration_dict
=
self
.
buildout
.
get
(
'storage-configuration'
)
network_dict
=
self
.
buildout
.
get
(
'network-information'
)
storage_home
=
''
global_ipv4_network
=
''
if
storage_configuration_dict
:
storage_home
=
storage_configuration_dict
.
get
(
'storage-home'
)
if
network_dict
:
global_ipv4_network
=
network_dict
.
get
(
'global-ipv4-network'
)
slap
.
initializeConnection
(
server_url
,
key_file
,
cert_file
)
self
.
computer_partition
=
slap
.
registerComputerPartition
(
computer_id
,
...
...
@@ -173,6 +177,8 @@ class Recipe:
buildout
.
set
(
'slap-network-information'
,
'tap-gateway'
,
tap_gateway
)
buildout
.
set
(
'slap-network-information'
,
'tap-netmask'
,
tap_netmask
)
buildout
.
set
(
'slap-network-information'
,
'tap-network'
,
tap_network
)
buildout
.
set
(
'slap-network-information'
,
'global-ipv4-network'
,
global_ipv4_network
)
# Copy/paste slap_connection
buildout
.
add_section
(
'slap-connection'
)
...
...
software/kvm/common.cfg
View file @
fa82cc5c
...
...
@@ -85,7 +85,7 @@ command =
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
md5sum =
d2413a9d4978092e939418748585bbb3
md5sum =
8debca5cccf4c365f8709523aa57e2fb
output = ${buildout:directory}/template.cfg
mode = 0644
...
...
@@ -93,7 +93,7 @@ mode = 0644
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2
mode = 644
md5sum =
c8f69039aff15e20447c6e522267c152
md5sum =
8c736cf6b5768423224a1b0ea2a90349
download-only = true
on-update = true
...
...
software/kvm/instance-kvm.cfg.jinja2
View file @
fa82cc5c
...
...
@@ -257,8 +257,13 @@ nat-rule-url-{{port}} = [${slap-network-information:global-ipv6}]:{{external_por
{% if slapparameter_dict.get('use-tap', 'False') == 'True' and tap_network_dict.has_key('ipv4') -%}
1_info = Use these configurations below to configure interface {{ iface }} in your VM.
2_info = ifconfig {{ iface }} ${slap-network-information:tap-ipv4} netmask ${slap-network-information:tap-netmask}
3_info = route add
-host
${slap-network-information:tap-gateway} dev {{ iface }}
3_info = route add ${slap-network-information:tap-gateway} dev {{ iface }}
4_info = route add -net ${slap-network-information:tap-network} netmask ${slap-network-information:tap-netmask} gw ${slap-network-information:tap-gateway}
{% if iface == 'eth0' -%}
5_info = route add default gw ${slap-network-information:tap-gateway}
{% elif global_ipv4_prefix -%}
5_info = ip route add {{ global_ipv4_prefix }} via ${slap-network-information:tap-gateway} dev {{ iface }} src ${slap-network-information:tap-ipv4}
{% endif -%}
{% endif -%}
...
...
software/kvm/instance.cfg.in
View file @
fa82cc5c
...
...
@@ -27,6 +27,9 @@ pull-backup = ${template-pull-backup:output}
[storage-configuration]
storage-home =
[network-information]
global-ipv4-network =
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
computer = $${slap-connection:computer-id}
...
...
@@ -47,6 +50,7 @@ context =
key eggs_directory buildout:eggs-directory
key ipv4 slap-configuration:ipv4
key ipv6 slap-configuration:ipv6
key global_ipv4_prefix network-information:global-ipv4-network
key tap_network_dict slap-configuration:tap-network-information-dict
key storage_dict slap-configuration:storage-dict
key slapparameter_dict slap-configuration:configuration
...
...
@@ -70,6 +74,7 @@ extensions = jinja2.ext.do
context =
key develop_eggs_directory buildout:develop-eggs-directory
key eggs_directory buildout:eggs-directory
key global_ipv4_prefix network-information:global-ipv4-network
key slapparameter_dict slap-configuration:configuration
key storage_dict slap-configuration:storage-dict
key tap_network_dict slap-configuration:tap-network-information-dict
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment