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
Cédric Le Ninivin
slapos
Commits
1ce3bb3f
Commit
1ce3bb3f
authored
Dec 06, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add slave system in kvm and kvm_frontend (WIP)
parent
b5cb205a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
9 deletions
+39
-9
slapos/recipe/kvm/__init__.py
slapos/recipe/kvm/__init__.py
+37
-7
slapos/recipe/kvm_frontend/__init__.py
slapos/recipe/kvm_frontend/__init__.py
+2
-2
No files found.
slapos/recipe/kvm/__init__.py
View file @
1ce3bb3f
...
@@ -35,6 +35,8 @@ import pkg_resources
...
@@ -35,6 +35,8 @@ import pkg_resources
import
ConfigParser
import
ConfigParser
import
hashlib
import
hashlib
FALSE_VALUE_LIST
=
[
'n'
,
'no'
,
'0'
,
'false'
]
class
Recipe
(
BaseSlapRecipe
):
class
Recipe
(
BaseSlapRecipe
):
# To avoid magic numbers
# To avoid magic numbers
...
@@ -86,13 +88,41 @@ class Recipe(BaseSlapRecipe):
...
@@ -86,13 +88,41 @@ class Recipe(BaseSlapRecipe):
target_port
=
vnc_port
)
target_port
=
vnc_port
)
self
.
linkBinary
()
self
.
linkBinary
()
self
.
computer_partition
.
setConnectionDict
(
dict
(
url
=
"https://[%s]:%s/vnc_auto.html?host=[%s]&port=%s&encrypt=1"
%
(
ipv6_url
=
'https://[%s]:%s/vnc_auto.html?host=[%s]&port=%s&encrypt=1'
%
(
noVNC_conf
[
'source_ip'
],
noVNC_conf
[
'source_ip'
],
noVNC_conf
[
'source_port'
],
noVNC_conf
[
'source_port'
],
noVNC_conf
[
'source_ip'
],
noVNC_conf
[
'source_port'
])
noVNC_conf
[
'source_ip'
],
noVNC_conf
[
'source_port'
]),
# Request frontend slave instance, unless contrary is specified
password
=
kvm_conf
[
'vnc_passwd'
]))
# XXX-Cedric : HARDCODE : during dev, request is OPT-IN
request_frontend
=
self
.
parameter_dict
.
get
(
'frontend'
,
'false'
)
#request_frontend = self.parameter_dict.get('frontend', True)
if
not
request_frontend
in
FALSE_VALUE_LIST
:
slave_frontend
=
self
.
request
(
# XXX-Cedric : how to "de-hardcode" url?
software_release
=
'/opt/slapdev/software/kvm-frontend/software.cfg'
,
software_type
=
'RootInstanceSoftware'
,
partition_reference
=
'%s_frontend'
%
self
.
computer_partition_id
,
shared
=
True
)
url
=
'https://%s:%s/%s/vnc_auto.html?host=%s&port=%s&encrypt=1&path=%s'
%
(
# XXX-Cedric : uh? how to fetch slave url/port/reference?
slave_frontend
.
getParameter
(
'domain'
),
slave_frontend
.
getParameter
(
'port'
),
slave_frontend
.
get
(
'reference'
),
slave_frontend
.
getParameter
(
'domain'
),
slave_frontend
.
getParameter
(
'port'
),
slave_frontend
.
get
(
'reference'
))
connection_dict
=
dict
(
url
=
url
,
backend_url
=
ipv6_url
,
password
=
kvm_conf
[
'vnc_passwd'
])
else
:
connection_dict
=
dict
(
url
=
ipv6_url
,
password
=
kvm_conf
[
'vnc_passwd'
])
self
.
computer_partition
.
setConnectionDict
(
connection_dict
)
return
self
.
path_list
return
self
.
path_list
...
...
slapos/recipe/kvm_frontend/__init__.py
View file @
1ce3bb3f
...
@@ -101,10 +101,10 @@ class Recipe(BaseSlapRecipe):
...
@@ -101,10 +101,10 @@ class Recipe(BaseSlapRecipe):
for
reference
,
url
in
slave_dict
.
iteritems
():
for
reference
,
url
in
slave_dict
.
iteritems
():
self
.
setConnectionDict
(
dict
(
site_url
=
url
),
reference
)
self
.
setConnectionDict
(
dict
(
site_url
=
url
),
reference
)
# XXX-Cedric : how to get/set slave parameters?
self
.
setConnectionDict
(
self
.
setConnectionDict
(
dict
(
site_url
=
node_parameter_dict
[
'site_url'
],
dict
(
site_url
=
node_parameter_dict
[
'site_url'
],
domain_ipv6_address
=
self
.
getGlobalIPv6Address
(),
domain_ipv6_address
=
self
.
getGlobalIPv6Address
()))
domain_ipv4_address
=
self
.
getLocalIPv4Address
()))
return
self
.
path_list
return
self
.
path_list
def
installLogrotate
(
self
):
def
installLogrotate
(
self
):
...
...
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