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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
slapos
Commits
f4a371c6
Commit
f4a371c6
authored
Aug 13, 2013
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First Openstack-Compute Autoconfigure Node
parent
f71776d4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
586 additions
and
173 deletions
+586
-173
software/openstack/instance-compute.cfg
software/openstack/instance-compute.cfg
+152
-71
software/openstack/instance-main.cfg
software/openstack/instance-main.cfg
+74
-68
software/openstack/software.cfg
software/openstack/software.cfg
+28
-33
software/openstack/templates/configure.sh.in
software/openstack/templates/configure.sh.in
+242
-0
software/openstack/templates/kvm-run.in
software/openstack/templates/kvm-run.in
+14
-1
software/openstack/templates/ssh-configure.py.in
software/openstack/templates/ssh-configure.py.in
+76
-0
No files found.
software/openstack/instance-compute.cfg
View file @
f4a371c6
...
@@ -7,11 +7,7 @@
...
@@ -7,11 +7,7 @@
parts =
parts =
certificate-authority
certificate-authority
kvm-instance
kvm-instance
kvm-controller-instance
kvm-promise
kvm-promise
tunnel-ipv6-ssh
tunnel-ipv6-http
tunnel-ipv6-https
tunnel-ipv6-keystone
tunnel-ipv6-keystone
tunnel-ipv6-keystone-admin
tunnel-ipv6-keystone-admin
tunnel-ipv6-keystone-compute
tunnel-ipv6-keystone-compute
...
@@ -22,6 +18,7 @@ parts =
...
@@ -22,6 +18,7 @@ parts =
tunnel-ipv6-novadb
tunnel-ipv6-novadb
tunnel-ipv6-rabbit
tunnel-ipv6-rabbit
tunnel-ipv6-ec2
tunnel-ipv6-ec2
nova-configure
websockify-sighandler
websockify-sighandler
novnc-promise
novnc-promise
publish-kvm-connection-information
publish-kvm-connection-information
...
@@ -42,6 +39,8 @@ promises = $${:etc}/promise
...
@@ -42,6 +39,8 @@ promises = $${:etc}/promise
novnc-conf = $${:etc}/novnc
novnc-conf = $${:etc}/novnc
run = $${:var}/run
run = $${:var}/run
ca-dir = $${:srv}/ssl
ca-dir = $${:srv}/ssl
nova = $${:bin}/nova
log = $${:var}/log
[create-mac]
[create-mac]
recipe = slapos.cookbook:generate.mac
recipe = slapos.cookbook:generate.mac
...
@@ -52,56 +51,99 @@ recipe = slapos.cookbook:generate.password
...
@@ -52,56 +51,99 @@ recipe = slapos.cookbook:generate.password
storage-path = $${directory:srv}/passwd
storage-path = $${directory:srv}/passwd
bytes = 8
bytes = 8
[gen-kvm-run]
[kvm-instance]
recipe = slapos.cookbook:kvm
vnc-passwd = $${gen-passwd:passwd}
ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
vnc-ip = $${:ipv4}
vnc-port = 5901
# XXX-Cedric: should be named "default-cdrom-iso"
default-disk-image = ${debian-amd64-netinst.iso:location}/${debian-amd64-netinst.iso:filename}
nbd-host = $${slap-parameter:nbd-host}
nbd-port = $${slap-parameter:nbd-port}
nbd2-host = $${slap-parameter:nbd2-host}
nbd2-port = $${slap-parameter:nbd2-port}
tap-interface = $${slap-network-information:network-interface}
disk-path = $${directory:srv}/virtual.qcow2
disk-size = $${slap-parameter:disk-size}
disk-type = $${slap-parameter:disk-type}
socket-path = $${directory:var}/qmp_socket
pid-file-path = $${directory:run}/kvm_run.pid
smp-count = $${slap-parameter:cpu-count}
ram-size = $${slap-parameter:ram-size}
mac-address = $${create-mac:mac-address}
# XXX-Cedric: should be named runner-wrapper-path and controller-wrapper-path
runner-path = $${directory:services}/kvm
controller-path = $${directory:scripts}/kvm_controller
use-tap = False
nat-rules = 22 80 443
6tunnel-wrapper-path = $${directory:services}/6tunnel
virtual-hard-drive-url = $${slap-parameter:virtual-hard-drive-url}
virtual-hard-drive-md5sum = $${slap-parameter:virtual-hard-drive-md5sum}
shell-path = ${dash:location}/bin/dash
qemu-path = ${kvm:location}/bin/qemu-system-x86_64
qemu-img-path = ${kvm:location}/bin/qemu-img
6tunnel-path = ${6tunnel:location}/bin/6tunnel
[kvm-promise]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promises}/vnc_promise
hostname = $${kvm-instance:vnc-ip}
port = $${kvm-instance:vnc-port}
[ssh-port-check]
recipe = slapos.cookbook:check_port_listening
path = $${directory:nova}/ssh_port_check
hostname = $${tunnel-ipv6-ssh:ipv4}
port = $${tunnel-ipv6-ssh:ipv4-port}
[nova-conf]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${
kvm-run:location}/${kvm-run
:filename}
url = ${
compute-script:location}/${compute-script
:filename}
output = $${directory:
bin}/kvm_run_raw
output = $${directory:
nova}/nova_configure.sh
mode = 0700
mode = 0700
software_type = compute
nova-url = https://github.com/openstack/nova.git
python_path = ${buildout:executable}
slap-ipv4 = $${slap-network-information:local-ipv4}
disk_path = $${directory:srv}/virtual.qcow2
nova-passwd = $${slap-parameter:master-passwd}
qemu_img_path = ${kvm:location}/bin/qemu-img
vnc-url = $${request-openstack-vnc-frontend:connection-url}
disk_size = $${slap-parameter:disk-size}
nova-host = $${slap-parameter:host}
vnc_ip = $${slap-network-information:local-ipv4}
qemu_path = ${kvm:location}/bin/qemu-system-x86_64
[nova-conf-run]
mac_address = $${create-mac:mac-address}
smp_count = $${slap-parameter:cpu-count}
ram_size = $${slap-parameter:ram-size}
disk_type = $${slap-parameter:disk-type}
boot_disk_path = $${directory:srv}/boot.qcow2
socket_path = $${directory:var}/qmp_socket
pid_file_path = $${directory:run}/kvm_run.pid
nbd_ip = $${slap-parameter:nbd-ip}
nbd_port = 1024
vnc_port = 5901
[gen-kvm-controller]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${
kvm-controller:location}/${kvm-controller
:filename}
url = ${
compute-script-run:location}/${compute-script-run
:filename}
output = $${directory:
bin}/kvm_controller_raw
output = $${directory:
nova}/nova_configure.py
mode = 0700
mode = 0700
host-ip = $${tunnel-ipv6-ssh:ipv6}
ssh-port = $${tunnel-ipv6-ssh:ipv6-port}
system-user = $${slap-parameter:system-user}
system-passwd = $${slap-parameter:system-passwd}
nova-configure = $${nova-conf:output}
nova-result = $${directory:log}
ssh-check-script = $${ssh-port-check:path}
python_path = ${buildout:executable}
python_path = ${buildout:executable}
socket_path = $${directory:var}/qmp_socket
eggs-dir = ${buildout:eggs-directory}
vnc_passwd = $${gen-passwd:passwd}
[kvm-controller-instance]
recipe = slapos.cookbook:wrapper
command-line = $${gen-kvm-controller:output}
wrapper-path = $${directory:scripts}/kvm_controller
[
kvm-instanc
e]
[
nova-configur
e]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:wrapper
command-line = $${
gen-kvm
-run:output}
command-line = $${
nova-conf
-run:output}
wrapper-path = $${directory:s
ervices}/kvm
wrapper-path = $${directory:s
cripts}/nova-configure
[kvm-promise]
recipe = slapos.cookbook:check_port_listening
path = $${directory:promises}/vnc_promise
hostname = $${gen-kvm-run:vnc_ip}
port = $${gen-kvm-run:vnc_port}
##########CONFIGURE TUNNELS##########################
[tunnel-ipv6-base]
[tunnel-ipv6-base]
recipe = slapos.cookbook:ipv6toipv4
recipe = slapos.cookbook:ipv6toipv4
ipv6 = $${slap-network-information:global-ipv6}
ipv6 = $${slap-network-information:global-ipv6}
...
@@ -117,22 +159,28 @@ shell-path = ${dash:location}/bin/dash
...
@@ -117,22 +159,28 @@ shell-path = ${dash:location}/bin/dash
6tunnel-path = ${6tunnel:location}/bin/6tunnel
6tunnel-path = ${6tunnel:location}/bin/6tunnel
[tunnel-ipv6-ssh]
[tunnel-ipv6-ssh]
<= tunnel-ipv6-base
ipv6-port = 10022
ipv
6-port = 222
22
ipv
4-port = 100
22
ipv
4-port = 22222
ipv
6 = $${slap-network-information:global-ipv6}
runner-path = $${directory:services}/6tunnel-ssh
ipv4 = $${slap-network-information:local-ipv4}
[tunnel-ipv6-http
]
#[tunnel-ipv6-ssh
]
<= tunnel-ipv6-base
#
<= tunnel-ipv6-base
ipv6-port = 80
#ipv6-port = 22222
ipv4-port = 80
#ipv4-port = 10022
runner-path = $${directory:services}/6tunnel-http
#runner-path = $${directory:services}/6tunnel-ssh
[tunnel-ipv6-https]
#[tunnel-ipv6-http]
<= tunnel-ipv6-base
#<= tunnel-ipv6-base
ipv6-port = 443
#ipv6-port = 80
ipv4-port = 443
#ipv4-port = 10080
runner-path = $${directory:services}/6tunnel-https
#runner-path = $${directory:services}/6tunnel-http
#[tunnel-ipv6-https]
#<= tunnel-ipv6-base
#ipv6-port = 443
#ipv4-port = 10443
#runner-path = $${directory:services}/6tunnel-https
[tunnel-ipv6-keystone]
[tunnel-ipv6-keystone]
<= tunnel-ipv4-to6
<= tunnel-ipv4-to6
...
@@ -153,7 +201,7 @@ ipv4-port = 8774
...
@@ -153,7 +201,7 @@ ipv4-port = 8774
runner-path = $${directory:services}/6tunnel-keystone-compute
runner-path = $${directory:services}/6tunnel-keystone-compute
[tunnel-ipv6-novnc]
[tunnel-ipv6-novnc]
<= tunnel-ipv
4-to6
<= tunnel-ipv
6-base
ipv6-port = 6080
ipv6-port = 6080
ipv4-port = 6080
ipv4-port = 6080
runner-path = $${directory:services}/6tunnel-novnc
runner-path = $${directory:services}/6tunnel-novnc
...
@@ -165,7 +213,7 @@ ipv4-port = 9292
...
@@ -165,7 +213,7 @@ ipv4-port = 9292
runner-path = $${directory:services}/6tunnel-glance
runner-path = $${directory:services}/6tunnel-glance
[tunnel-ipv6-spice]
[tunnel-ipv6-spice]
<= tunnel-ipv
4-to6
<= tunnel-ipv
6-base
ipv6-port = 6082
ipv6-port = 6082
ipv4-port = 6082
ipv4-port = 6082
runner-path = $${directory:services}/6tunnel-spice
runner-path = $${directory:services}/6tunnel-spice
...
@@ -195,13 +243,15 @@ ipv6-port = 3306
...
@@ -195,13 +243,15 @@ ipv6-port = 3306
ipv4-port = 3306
ipv4-port = 3306
runner-path = $${directory:services}/6tunnel-novadb
runner-path = $${directory:services}/6tunnel-novadb
#########INSTALL NOVNC FOR KVM IMAGE################
[novnc-instance]
[novnc-instance]
recipe = slapos.cookbook:novnc
recipe = slapos.cookbook:novnc
path = $${ca-novnc:executable}
path = $${ca-novnc:executable}
ip = $${slap-network-information:global-ipv6}
ip = $${slap-network-information:global-ipv6}
port = 60
81
port = 60
90
vnc-ip = $${
gen-kvm-run:vnc_
ip}
vnc-ip = $${
kvm-instance:vnc-
ip}
vnc-port = $${
gen-kvm-run:vnc_
port}
vnc-port = $${
kvm-instance:vnc-
port}
novnc-location = ${noVNC:location}
novnc-location = ${noVNC:location}
websockify-path = ${buildout:directory}/bin/websockify
websockify-path = ${buildout:directory}/bin/websockify
ssl-key-path = $${ca-novnc:key-file}
ssl-key-path = $${ca-novnc:key-file}
...
@@ -251,9 +301,10 @@ recipe = slapos.cookbook:generic.slapmonitor
...
@@ -251,9 +301,10 @@ recipe = slapos.cookbook:generic.slapmonitor
db-path = $${directory:srv}/slapmonitor_database
db-path = $${directory:srv}/slapmonitor_database
##############REQUEST FRONTEND AND PUBLISH CONNEXION PARAMETERS############
[request-slave-frontend]
[request-slave-frontend]
recipe = slapos.cookbook:requestoptional
recipe = slapos.cookbook:requestoptional
software-url = $${slap-parameter:
frontend-software
-url}
software-url = $${slap-parameter:
kvm-frontend
-url}
server-url = $${slap-connection:server-url}
server-url = $${slap-connection:server-url}
key-file = $${slap-connection:key-file}
key-file = $${slap-connection:key-file}
cert-file = $${slap-connection:cert-file}
cert-file = $${slap-connection:cert-file}
...
@@ -269,27 +320,57 @@ return = url resource port domainname
...
@@ -269,27 +320,57 @@ return = url resource port domainname
#sla = instance_guid
#sla = instance_guid
#sla-instance_guid = $${slap-parameter:frontend-instance-guid}
#sla-instance_guid = $${slap-parameter:frontend-instance-guid}
[request-openstack-vnc-frontend]
recipe = slapos.cookbook:requestoptional
software-url = $${slap-parameter:kvm-frontend-url}
server-url = $${slap-connection:server-url}
key-file = $${slap-connection:key-file}
cert-file = $${slap-connection:cert-file}
computer-id = $${slap-connection:computer-id}
partition-id = $${slap-connection:partition-id}
name = OpenStack VNC Frontend
software-type = $${slap-parameter:frontend-software-type}
slave = true
config = host port
config-host = $${slap-network-information:global-ipv6}
config-port = $${tunnel-ipv6-novnc:ipv6-port}
return = url resource port domainname
sla = instance_guid
sla-instance_guid = $${slap-parameter:frontend-instance-guid}
[publish-kvm-connection-information]
[publish-kvm-connection-information]
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish
vnc-backend-url = https://[$${novnc-instance:ip}]:$${novnc-instance:port}/vnc_auto.html?host=[$${novnc-instance:ip}]&port=$${novnc-instance:port}&encrypt=1
vnc-backend-url = https://[$${novnc-instance:ip}]:$${novnc-instance:port}/vnc_auto.html?host=[$${novnc-instance:ip}]&port=$${novnc-instance:port}&encrypt=1&password=$${kvm-instance:vnc-passwd}
vnc-password = $${gen-passwd:passwd}
vnc-url = $${request-slave-frontend:connection-url}/vnc_auto.html?host=$${request-slave-frontend:connection-domainname}&port=$${request-slave-frontend:connection-port}&encrypt=1&path=$${request-slave-frontend:connection-resource}&password=$${kvm-instance:vnc-passwd}
vnc-url = $${request-slave-frontend:connection-url}/vnc_auto.html?host=$${request-slave-frontend:connection-domainname}&port=$${request-slave-frontend:connection-port}&encrypt=1&path=$${request-slave-frontend:connection-resource}
ssh = ssh $${slap-parameter:system-user}@$${tunnel-ipv6-ssh:ipv6} -p $${tunnel-ipv6-ssh:ipv6-port}
ssh = ssh stack@$${tunnel-ipv6-ssh:ipv6} -p $${tunnel-ipv6-ssh:ipv6-port}
ssh-defaul-passwd = $${slap-parameter:system-passwd}
ssh-defaul-passwd = openstack
local-ipv4 = $${slap-network-information:local-ipv4}
local-ipv4 = $${slap-network-information:local-ipv4}
[slap-parameter]
[slap-parameter]
# Default values if not specified
# Default values if not specified
#frontend-instance-guid = SOFTINST-81
#frontend-instance-guid = SOFTINST-81
frontend-software-type = frontend
frontend-software-type = frontend
frontend-software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.92:/software/kvm/software.cfg
kvm-frontend-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.92:/software/kvm/software.cfg
frontend-instance-guid =
ram-size = 2048
ram-size = 2048
disk-size = 20
disk-size = 20
disk-type = virtio
disk-type = virtio
cpu-count = 4
cpu-count = 4
nbd-ip = 2001:470:1f14:169:dd6b:3f84:9205:c750
nbd-port = 1024
nbd-host = 2001:470:1f14:169:dd6b:3f84:9205:c750
nbd2-port = 1024
nbd2-host =
domain =
domain =
master-address = 2001:470:1f14:169:dd6b:3f84:9205:
73a4
master-address = 2001:470:1f14:169:dd6b:3f84:9205:
cd50
master-passwd = openstack
master-passwd = openstack
system-user = stack
system-passwd = openstack
#XXX- This host name should be changed as soon as possible, to avoid having two or more identical
#compute host name on the same openstack-Manager node.
host = nova.compute-$${slap-connection:computer-id}
virtual-hard-drive-url =
virtual-hard-drive-md5sum =
\ No newline at end of file
software/openstack/instance-main.cfg
View file @
f4a371c6
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
parts =
parts =
certificate-authority
certificate-authority
kvm-instance
kvm-instance
kvm-controller-instance
tunnel-ipv6-ssh
tunnel-ipv6-ssh
tunnel-ipv6-http
tunnel-ipv6-http
tunnel-ipv6-https
tunnel-ipv6-https
...
@@ -53,55 +52,57 @@ recipe = slapos.cookbook:generate.password
...
@@ -53,55 +52,57 @@ recipe = slapos.cookbook:generate.password
storage-path = $${directory:srv}/passwd
storage-path = $${directory:srv}/passwd
bytes = 8
bytes = 8
[gen-kvm-run]
recipe = slapos.recipe.template
url = ${kvm-run:location}/${kvm-run:filename}
output = $${directory:bin}/kvm_run_raw
mode = 0700
software_type = main
python_path = ${buildout:executable}
disk_path = $${directory:srv}/virtual.qcow2
qemu_img_path = ${kvm:location}/bin/qemu-img
disk_size = $${slap-parameter:disk-size}
vnc_ip = $${slap-network-information:local-ipv4}
qemu_path = ${kvm:location}/bin/qemu-system-x86_64
mac_address = $${create-mac:mac-address}
smp_count = $${slap-parameter:cpu-count}
ram_size = $${slap-parameter:ram-size}
disk_type = $${slap-parameter:disk-type}
boot_disk_path = $${directory:srv}/boot.qcow2
socket_path = $${directory:var}/qmp_socket
pid_file_path = $${directory:run}/kvm_run.pid
nbd_ip = $${slap-parameter:nbd-ip}
nbd_port = 1024
vnc_port = 5901
[gen-kvm-controller]
recipe = slapos.recipe.template
url = ${kvm-controller:location}/${kvm-controller:filename}
output = $${directory:bin}/kvm_controller_raw
mode = 0700
python_path = ${buildout:executable}
socket_path = $${directory:var}/qmp_socket
vnc_passwd = $${gen-passwd:passwd}
[kvm-controller-instance]
recipe = slapos.cookbook:wrapper
command-line = $${gen-kvm-controller:output}
wrapper-path = $${directory:scripts}/kvm_controller
[kvm-instance]
[kvm-instance]
recipe = slapos.cookbook:wrapper
recipe = slapos.cookbook:kvm
command-line = $${gen-kvm-run:output}
vnc-passwd = $${gen-passwd:passwd}
wrapper-path = $${directory:services}/kvm
ipv4 = $${slap-network-information:local-ipv4}
ipv6 = $${slap-network-information:global-ipv6}
vnc-ip = $${:ipv4}
vnc-port = 5901
# XXX-Cedric: should be named "default-cdrom-iso"
default-disk-image = ${debian-amd64-netinst.iso:location}/${debian-amd64-netinst.iso:filename}
nbd-host = $${slap-parameter:nbd-host}
nbd-port = $${slap-parameter:nbd-port}
nbd2-host = $${slap-parameter:nbd2-host}
nbd2-port = $${slap-parameter:nbd2-port}
tap-interface = $${slap-network-information:network-interface}
disk-path = $${directory:srv}/virtual.qcow2
disk-size = $${slap-parameter:disk-size}
disk-type = $${slap-parameter:disk-type}
socket-path = $${directory:var}/qmp_socket
pid-file-path = $${directory:run}/kvm_run.pid
smp-count = $${slap-parameter:cpu-count}
ram-size = $${slap-parameter:ram-size}
mac-address = $${create-mac:mac-address}
# XXX-Cedric: should be named runner-wrapper-path and controller-wrapper-path
runner-path = $${directory:services}/kvm
controller-path = $${directory:scripts}/kvm_controller
use-tap = False
nat-rules = 22, 80, 443, 5000, 6080, 6082, 3333, 9292, 3306, 35357
6tunnel-wrapper-path = $${directory:services}/6tunnel
virtual-hard-drive-url = $${slap-parameter:virtual-hard-drive-url}
virtual-hard-drive-md5sum = $${slap-parameter:virtual-hard-drive-md5sum}
shell-path = ${dash:location}/bin/dash
qemu-path = ${kvm:location}/bin/qemu-system-x86_64
qemu-img-path = ${kvm:location}/bin/qemu-img
6tunnel-path = ${6tunnel:location}/bin/6tunnel
[kvm-promise]
[kvm-promise]
recipe = slapos.cookbook:check_port_listening
recipe = slapos.cookbook:check_port_listening
path = $${directory:promises}/vnc_promise
path = $${directory:promises}/vnc_promise
hostname = $${
gen-kvm-run
:vnc_ip}
hostname = $${
kvm-instance
:vnc_ip}
port = $${
gen-kvm-run
:vnc_port}
port = $${
kvm-instance
:vnc_port}
[tunnel-ipv6-base]
[tunnel-ipv6-base]
recipe = slapos.cookbook:ipv6toipv4
recipe = slapos.cookbook:ipv6toipv4
...
@@ -113,80 +114,80 @@ shell-path = ${dash:location}/bin/dash
...
@@ -113,80 +114,80 @@ shell-path = ${dash:location}/bin/dash
[tunnel-ipv6-ssh]
[tunnel-ipv6-ssh]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 22222
ipv6-port = 22222
ipv4-port =
222
22
ipv4-port =
100
22
runner-path = $${directory:services}/6tunnel-ssh
runner-path = $${directory:services}/6tunnel-ssh
[tunnel-ipv6-http]
[tunnel-ipv6-http]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 80
ipv6-port = 80
80
ipv4-port = 80
ipv4-port =
100
80
runner-path = $${directory:services}/6tunnel-http
runner-path = $${directory:services}/6tunnel-http
[tunnel-ipv6-https]
[tunnel-ipv6-https]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 443
ipv6-port = 44
4
3
ipv4-port = 443
ipv4-port =
10
443
runner-path = $${directory:services}/6tunnel-https
runner-path = $${directory:services}/6tunnel-https
[tunnel-ipv6-keystone]
[tunnel-ipv6-keystone]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 5000
ipv6-port = 5000
ipv4-port = 5000
ipv4-port =
1
5000
runner-path = $${directory:services}/6tunnel-keystone
runner-path = $${directory:services}/6tunnel-keystone
[tunnel-ipv6-keystone-admin]
[tunnel-ipv6-keystone-admin]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 35357
ipv6-port = 35357
ipv4-port =
3
5357
ipv4-port =
4
5357
runner-path = $${directory:services}/6tunnel-keystone-admin
runner-path = $${directory:services}/6tunnel-keystone-admin
[tunnel-ipv6-keystone-compute]
[tunnel-ipv6-keystone-compute]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 8774
ipv6-port = 8774
ipv4-port = 8774
ipv4-port =
1
8774
runner-path = $${directory:services}/6tunnel-keystone-compute
runner-path = $${directory:services}/6tunnel-keystone-compute
[tunnel-ipv6-novnc]
[tunnel-ipv6-novnc]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 6080
ipv6-port = 6080
ipv4-port = 6080
ipv4-port =
1
6080
runner-path = $${directory:services}/6tunnel-novnc
runner-path = $${directory:services}/6tunnel-novnc
[tunnel-ipv6-glance]
[tunnel-ipv6-glance]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 9292
ipv6-port = 9292
ipv4-port = 9292
ipv4-port =
1
9292
runner-path = $${directory:services}/6tunnel-glance
runner-path = $${directory:services}/6tunnel-glance
[tunnel-ipv6-rabbit]
[tunnel-ipv6-rabbit]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 5672
ipv6-port = 5672
ipv4-port = 5672
ipv4-port =
1
5672
runner-path = $${directory:services}/6tunnel-rabbit
runner-path = $${directory:services}/6tunnel-rabbit
[tunnel-ipv6-spice]
[tunnel-ipv6-spice]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 6082
ipv6-port = 6082
ipv4-port = 6082
ipv4-port =
1
6082
runner-path = $${directory:services}/6tunnel-spice
runner-path = $${directory:services}/6tunnel-spice
[tunnel-ipv6-ec2]
[tunnel-ipv6-ec2]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 8773
ipv6-port = 8773
ipv4-port = 8773
ipv4-port =
1
8773
runner-path = $${directory:services}/6tunnel-ec2
runner-path = $${directory:services}/6tunnel-ec2
#I don't know if this is really usefull!!
#I don't know if this is really usefull!!
[tunnel-ipv6-s3api]
[tunnel-ipv6-s3api]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 3333
ipv6-port = 3333
ipv4-port = 3333
ipv4-port =
1
3333
runner-path = $${directory:services}/6tunnel-s3api
runner-path = $${directory:services}/6tunnel-s3api
[tunnel-ipv6-novadb]
[tunnel-ipv6-novadb]
<= tunnel-ipv6-base
<= tunnel-ipv6-base
ipv6-port = 3306
ipv6-port = 3306
ipv4-port = 3306
ipv4-port =
1
3306
runner-path = $${directory:services}/6tunnel-novadb
runner-path = $${directory:services}/6tunnel-novadb
[novnc-instance]
[novnc-instance]
...
@@ -194,8 +195,8 @@ recipe = slapos.cookbook:novnc
...
@@ -194,8 +195,8 @@ recipe = slapos.cookbook:novnc
path = $${ca-novnc:executable}
path = $${ca-novnc:executable}
ip = $${slap-network-information:global-ipv6}
ip = $${slap-network-information:global-ipv6}
port = 6090
port = 6090
vnc-ip = $${
gen-kvm-run:vnc_
ip}
vnc-ip = $${
kvm-instance:vnc-
ip}
vnc-port = $${
gen-kvm-run:vnc_
port}
vnc-port = $${
kvm-instance:vnc-
port}
novnc-location = ${noVNC:location}
novnc-location = ${noVNC:location}
websockify-path = ${buildout:directory}/bin/websockify
websockify-path = ${buildout:directory}/bin/websockify
ssl-key-path = $${ca-novnc:key-file}
ssl-key-path = $${ca-novnc:key-file}
...
@@ -276,7 +277,7 @@ software-type = $${slap-parameter:frontend-software-type}
...
@@ -276,7 +277,7 @@ software-type = $${slap-parameter:frontend-software-type}
slave = true
slave = true
config = host port
config = host port
config-host = $${slap-network-information:global-ipv6}
config-host = $${slap-network-information:global-ipv6}
config-port =
6080
config-port =
$${tunnel-ipv6-novnc:ipv6-port}
return = url resource port domainname
return = url resource port domainname
sla = instance_guid
sla = instance_guid
sla-instance_guid = $${slap-parameter:frontend-instance-guid}
sla-instance_guid = $${slap-parameter:frontend-instance-guid}
...
@@ -289,15 +290,14 @@ name = Frontend OpenStack
...
@@ -289,15 +290,14 @@ name = Frontend OpenStack
software-url = $${slap-parameter:frontend-software-url}
software-url = $${slap-parameter:frontend-software-url}
slave = true
slave = true
config = url custom_domain
config = url custom_domain
config-url = http://[$${
slap-network-information:global-ipv6}]:80
/
config-url = http://[$${
tunnel-ipv6-http:ipv6}]:$${tunnel-ipv6-http:ipv6-port}
/
return = site_url
return = site_url
config-custom_domain = $${slap-parameter:domain}
config-custom_domain = $${slap-parameter:domain}
[publish-kvm-connection-information]
[publish-kvm-connection-information]
recipe = slapos.cookbook:publish
recipe = slapos.cookbook:publish
vnc-backend-url = https://[$${novnc-instance:ip}]:$${novnc-instance:port}/vnc_auto.html?host=[$${novnc-instance:ip}]&port=$${novnc-instance:port}&encrypt=1
vnc-backend-url = https://[$${novnc-instance:ip}]:$${novnc-instance:port}/vnc_auto.html?host=[$${novnc-instance:ip}]&port=$${novnc-instance:port}&encrypt=1&password=$${kvm-instance:vnc-passwd}
vnc-password = $${gen-passwd:passwd}
vnc-url = $${request-slave-frontend:connection-url}/vnc_auto.html?host=$${request-slave-frontend:connection-domainname}&port=$${request-slave-frontend:connection-port}&encrypt=1&path=$${request-slave-frontend:connection-resource}&password=$${kvm-instance:vnc-passwd}
vnc-url = $${request-slave-frontend:connection-url}/vnc_auto.html?host=$${request-slave-frontend:connection-domainname}&port=$${request-slave-frontend:connection-port}&encrypt=1&path=$${request-slave-frontend:connection-resource}
ssh = ssh stack@$${tunnel-ipv6-ssh:ipv6} -p $${tunnel-ipv6-ssh:ipv6-port}
ssh = ssh stack@$${tunnel-ipv6-ssh:ipv6} -p $${tunnel-ipv6-ssh:ipv6-port}
ssh-defaul-passwd = openstack
ssh-defaul-passwd = openstack
openstack-url = $${request-openstack-frontend:connection-site_url}
openstack-url = $${request-openstack-frontend:connection-site_url}
...
@@ -323,7 +323,13 @@ frontend-instance-guid =
...
@@ -323,7 +323,13 @@ frontend-instance-guid =
ram-size = 2048
ram-size = 2048
disk-size = 20
disk-size = 20
disk-type = virtio
disk-type = virtio
virtual-hard-drive-url =
virtual-hard-drive-md5sum =
cpu-count = 4
cpu-count = 4
nbd-ip = 2001:470:1f14:169:dd6b:3f84:9205:c750
nbd-port = 1024
nbd-host = 2001:470:1f14:169:dd6b:3f84:9205:c750
nbd2-port = 1024
nbd2-host =
domain =
domain =
software/openstack/software.cfg
View file @
f4a371c6
...
@@ -21,20 +21,21 @@ recipe = z3c.recipe.scripts
...
@@ -21,20 +21,21 @@ recipe = z3c.recipe.scripts
eggs =
eggs =
${lxml-python:egg}
${lxml-python:egg}
websockify
websockify
paramiko
slapos.cookbook
slapos.cookbook
slapos.toolbox
slapos.toolbox
[template-openstack-main]
[template-openstack-main]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-main.cfg
url = ${:_profile_base_location_}/instance-main.cfg
md5sum =
b8a682bd167655653fb28dcfa9c57f3d
md5sum =
527962a0384547e37998cf055196e073
output = ${buildout:directory}/template-openstack-main.cfg
output = ${buildout:directory}/template-openstack-main.cfg
mode = 0644
mode = 0644
[template-openstack-compute]
[template-openstack-compute]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-compute.cfg
url = ${:_profile_base_location_}/instance-compute.cfg
md5sum =
360808856309c4ac83d36ccec18c71ed
md5sum =
4aa88cbefcb9f9bd175f31970e8f8c47
output = ${buildout:directory}/template-openstack-compute.cfg
output = ${buildout:directory}/template-openstack-compute.cfg
mode = 0644
mode = 0644
...
@@ -51,15 +52,15 @@ url = ${:_profile_base_location_}/templates/${:filename}
...
@@ -51,15 +52,15 @@ url = ${:_profile_base_location_}/templates/${:filename}
mode = 0644
mode = 0644
location = ${buildout:parts-directory}/${:_buildout_section_name_}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
[
kvm-controller
]
[
compute-script
]
<= template-download
<= template-download
filename =
kvm-controller-run
.in
filename =
configure.sh
.in
md5sum =
04a94f04344a6169af242dea03b8c52
d
md5sum =
73e5a796b8d27e20167f36732a1c9fa
d
[
kvm
-run]
[
compute-script
-run]
<= template-download
<= template-download
filename =
kvm-run
.in
filename =
ssh-configure.py
.in
md5sum =
7c05088023d252e98aa1574880dd1afb
md5sum =
bcbeabd3cd8f19d71ec9209d9edfbbf8
[networkcache]
[networkcache]
# signature certificates of the following uploaders.
# signature certificates of the following uploaders.
...
@@ -108,53 +109,53 @@ signature-certificate-list =
...
@@ -108,53 +109,53 @@ signature-certificate-list =
-----END CERTIFICATE-----
-----END CERTIFICATE-----
[versions]
[versions]
Jinja2 = 2.7
Jinja2 = 2.7
.1
MarkupSafe = 0.18
MarkupSafe = 0.18
Werkzeug = 0.9.3
Werkzeug = 0.9.3
apache-libcloud = 0.13.0
apache-libcloud = 0.13.0
async = 0.6.1
async = 0.6.1
buildout-versions = 1.7
buildout-versions = 1.7
gitdb = 0.5.4
gitdb = 0.5.4
itsdangerous = 0.2
2
itsdangerous = 0.2
3
lxml = 3.2.3
lxml = 3.2.3
meld3 = 0.6.10
meld3 = 0.6.10
pycrypto = 2.6
pycrypto = 2.6
slapos.cookbook = 0.
78.3
slapos.cookbook = 0.
80
slapos.recipe.cmmi = 0.2
slapos.recipe.cmmi = 0.2
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.
4.2
slapos.recipe.template = 2.
5
slapos.toolbox = 0.35.
0
slapos.toolbox = 0.35.
1
smmap = 0.8.2
smmap = 0.8.2
websockify = 0.5.1
websockify = 0.5.1
z3c.recipe.scripts = 1.0.1
z3c.recipe.scripts = 1.0.1
# Required by:
# Required by:
# slapos.core==0.35.1
# slapos.core==0.35.1
# slapos.toolbox==0.35.
0
# slapos.toolbox==0.35.
1
Flask = 0.10.1
Flask = 0.10.1
# Required by:
# Required by:
# slapos.toolbox==0.35.
0
# slapos.toolbox==0.35.
1
GitPython = 0.3.2.RC1
GitPython = 0.3.2.RC1
# Required by:
# Required by:
# slapos.toolbox==0.35.
0
# slapos.toolbox==0.35.
1
atomize = 0.1.1
atomize = 0.1.1
# Required by:
# Required by:
# slapos.toolbox==0.35.
0
# slapos.toolbox==0.35.
1
feedparser = 5.1.3
feedparser = 5.1.3
# Required by:
# Required by:
# slapos.cookbook==0.
78.3
# slapos.cookbook==0.
80
inotifyx = 0.2.0-1
inotifyx = 0.2.0-1
# Required by:
# Required by:
# slapos.cookbook==0.
78.3
# slapos.cookbook==0.
80
lock-file = 2.0
lock-file = 2.0
# Required by:
# Required by:
# slapos.cookbook==0.
78.3
# slapos.cookbook==0.
80
netaddr = 0.7.10
netaddr = 0.7.10
# Required by:
# Required by:
...
@@ -166,11 +167,11 @@ netifaces = 0.8-1
...
@@ -166,11 +167,11 @@ netifaces = 0.8-1
numpy = 1.7.1
numpy = 1.7.1
# Required by:
# Required by:
# slapos.toolbox==0.35.
0
# slapos.toolbox==0.35.
1
paramiko = 1.11.0
paramiko = 1.11.0
# Required by:
# Required by:
# slapos.toolbox==0.35.
0
# slapos.toolbox==0.35.
1
psutil = 1.0.1
psutil = 1.0.1
# Required by:
# Required by:
...
@@ -178,18 +179,12 @@ psutil = 1.0.1
...
@@ -178,18 +179,12 @@ psutil = 1.0.1
pyflakes = 0.7.3
pyflakes = 0.7.3
# Required by:
# Required by:
# slapos.cookbook==0.
78.3
# slapos.cookbook==0.
80
pytz = 2013b
pytz = 2013b
# Required by:
# Required by:
# slapos.cookbook==0.78.3
# slapos.cookbook==0.80
# slapos.core==0.35.1
# slapos.toolbox==0.35.1
# slapos.toolbox==0.35.0
setuptools = 0.9.8
# Required by:
# slapos.cookbook==0.78.3
# slapos.toolbox==0.35.0
slapos.core = 0.35.1
slapos.core = 0.35.1
# Required by:
# Required by:
...
@@ -201,8 +196,8 @@ supervisor = 3.0
...
@@ -201,8 +196,8 @@ supervisor = 3.0
unittest2 = 0.5.1
unittest2 = 0.5.1
# Required by:
# Required by:
# slapos.cookbook==0.
78.3
# slapos.cookbook==0.
80
# slapos.toolbox==0.35.
0
# slapos.toolbox==0.35.
1
xml-marshaller = 0.9.7
xml-marshaller = 0.9.7
# Required by:
# Required by:
...
...
software/openstack/templates/configure.sh.in
0 → 100644
View file @
f4a371c6
#!/usr/bin/env bash
#configure.sh: Should install and configure all needed openstack packages.
NETWORK_CONFIG
=
"/etc/network/interfaces"
BRCTL_EXEC
=
`
which brctl
`
GCC_EXEC
=
`
which gcc
`
GIT_EXEC
=
`
which git
`
NOV_URL
=
"
${
:nova-url
}
"
NOVA_CONFIG
=
"/etc/nova/nova.conf"
BASE_DIR
=
$HOME
EZ_SETUP
=
"http://peak.telecommunity.com/dist/ez_setup.py"
EASY_INSTALL
=
`
which easy_install
`
PYTHON
=
`
which python
`
NOVA_USER
=
$USER
IPv4
=
`
ip addr show eth0 |
grep
'inet '
|
awk
'{print $2}'
|
cut
-d
/
-f1
`
if
[
-z
"
$IPv4
"
]
;
then
IPv4
=
"127.0.0.1"
fi
echo
" "
echo
" "
echo
" "
echo
"#########################################################################################"
echo
"######### ###########"
echo
"######### AUTO CONFIGURE AND INSTALL SCRIPT FOR OPENSTACK NOVA-COMPUTE NODE ###########"
echo
"######### ###########"
echo
"######### ******Network ip adress:
$IPv4
###########"
echo
"######### ###########"
echo
"#########################################################################################"
echo
" "
echo
" "
echo
" "
ip
link set
eth0 promisc on
cat
>
$NETWORK_CONFIG
<<
EOF
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
# Bridge network interface for VM networks
auto br100
iface br100 inet static
address 192.168.100.1
netmask 255.255.255.0
bridge_stp off
bridge_fd 0
EOF
if
[
-z
"
$BRCTL_EXEC
"
-o
!
-x
"
$BRCTL_EXEC
"
]
;
then
apt-get
install
-y
bridge-utils
;
fi
$BRCTL_EXEC
addbr br100
#Restart the network to take new network configuration.
/etc/init.d/networking restart
if
[
-z
"
$GCC_EXEC
"
-o
!
-x
"
$GCC_EXEC
"
]
;
then
apt-get
install
-y
gcc g++
;
fi
apt-get
install
-y
python-dev
apt-get
install
-y
gnutls-bin gnutls-dev
apt-get
install
-y
libdevmapper-dev libdevmapper
apt-get
install
-y
python-all-dev
apt-get
install
-y
kvm libvirt-bin
apt-get
install
-y
python-libvirt
apt-get
install
-y
libxml2-dev libxslt-dev
apt-get
install
-y
python-lxml
if
[
-z
"
$GIT_EXEC
"
-o
!
-x
"
$GIT_EXEC
"
]
;
then
apt-get
install
-y
git
;
fi
#Remove all pip tmp cache is to prevent installation failure
rm
-rf
/tmp/pip_build_root/
*
#Install python packages*/
if
[
-z
"
$EASY_INSTALL
"
-o
!
-x
"
$EASY_INSTALL
"
]
;
then
cd
$BASE_DIR
;
wget
$EZ_SETUP
-O
ez_setup.py
;
$PYTHON
$BASE_DIR
/ez_setup.py
;
EASY_INSTALL
=
`
which easy_install
`
;
fi
$GIT_EXEC
clone
$NOV_URL
$BASE_DIR
/nova
;
chown
-R
$NOVA_USER
:
$BASE_DIR
/nova
$EASY_INSTALL
pip
$EASY_INSTALL
pbr
cd
$BASE_DIR
/nova
;
$PYTHON
setup.py
install
#Create Nova Working directory
mkdir
-p
/opt/stack
mkdir
-p
/opt/stack/data
mkdir
-p
/opt/stack/data/nova
mkdir
-p
/opt/stack/data/nova/instances
mkdir
-p
/opt/stack/log
cp
-rf
$BASE_DIR
/nova/etc/nova /etc/
cat
>
$NOVA_CONFIG
<<
EOF
[DEFAULT]
firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver
compute_driver = libvirt.LibvirtDriver
flat_interface = eth0
flat_network_bridge = br100
vlan_interface = eth0
public_interface = br100
network_manager = nova.network.manager.FlatDHCPManager
host =
${
:nova-host
}
glance_api_servers =
${
:slap-ipv4
}
:9292
rabbit_password =
${
:nova-passwd
}
rabbit_host =
${
:slap-ipv4
}
rpc_backend = nova.openstack.common.rpc.impl_kombu
ec2_dmz_host =
${
:slap-ipv4
}
vncserver_proxyclient_address =
$IPv4
vncserver_listen =
$IPv4
vnc_enabled = true
xvpvncproxy_base_url = http://
$IPv4
:6081/console
novncproxy_base_url =
${
:vnc-url
}
/vnc_auto.html
logging_exception_prefix = %(color)s%(asctime)s.%(msecs)03d TRACE %(name)s ESC[01;35m%(instance)sESC[00m
logging_debug_format_suffix = ESC[00;33mfrom (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)dESC[00m
logging_default_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [ESC[00;36m-%(color)s] ESC[01;35m%(instance)s%(color)s%(message)sESC[00m
logging_context_format_string = %(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [ESC[01;36m%(request_id)s ESC[00;36m%(user_name)s %(project_name)s%(color)s] ESC[01;35m%(instance)s%(color)s%(message)sESC[00m
instances_path = /opt/stack/data/nova/instances
lock_path = /opt/stack/data/nova
state_path = /opt/stack/data/nova
log_dir = /opt/stack/log
volume_api_class = nova.volume.cinder.API
enabled_apis = ec2,osapi_compute,metadata
instance_name_template = instance-%08x
libvirt_cpu_mode = none
libvirt_type = qemu
sql_connection = mysql://root:
${
:nova-passwd
}
@
${
:slap-ipv4
}
/nova?charset=utf8
my_ip =
$IPv4
osapi_compute_extension = nova.api.openstack.compute.contrib.standard_extensions
s3_port = 3333
s3_host =
${
:slap-ipv4
}
ec2_host =
${
:slap-ipv4
}
rabbit_host =
${
:slap-ipv4
}
osapi_compute_listen =
${
:slap-ipv4
}
keystone_ec2_url = http://
${
:slap-ipv4
}
:5000/v2.0/ec2tokens
default_floating_pool = public
iscsi_ip_prefix = 192.168.100
fixed_range =
force_dhcp_release = True
dhcpbridge_flagfile = /etc/nova/nova.conf
scheduler_driver = nova.scheduler.filter_scheduler.FilterScheduler
rootwrap_config = /etc/nova/rootwrap.conf
api_paste_config = /etc/nova/api-paste.ini
allow_resize_to_same_host = True
auth_strategy = keystone
debug = True
verbose = True
[osapi_v3]
enabled = True
[spice]
enabled = false
html5proxy_base_url = http://
$IPv4
:6082/spice_auto.html
EOF
NOVA_COMPUTE_EXEX
=
`
which nova-compute
`
if
[
-z
"
$EASY_INSTALL
"
-o
!
-x
"
$EASY_INSTALL
"
]
;
then
echo
"ERROR: can't find nova-compute executable file!!!!"
exit
1
fi
#Add Nova-compute in init.d If file not exist now
cat
>
/etc/init.d/nova-compute
<<
EOF
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=
$NOVA_COMPUTE_EXEX
NAME=nova-compute
DESC="OpenStack Conpute Node"
pid=
\`
ps ax | egrep nova-compute | egrep nova.conf | cut -d ' ' -f1
\`
case "
\$
1" in
start)
if [ -z "
\$
pid" ]; then
echo -n "Starting
\$
DESC:
\$
NAME"
$NOVA_COMPUTE_EXEX
--config-file
$NOVA_CONFIG
& > /dev/null
else
echo "
\$
DESC:
\$
NAME is curently under execution";
fi
echo "."
;;
stop)
if [ -z "
\$
pid" ]; then
echo " nova-compute isn't running, so not killed" ;
else
kill -TERM
\$
pid > /dev/null ;
fi
echo "."
;;
restart)
if [ -z "
\$
pid" ]; then
echo " nova-compute isn't running!!" ;
else
kill -TERM
\$
pid > /dev/null ;
fi
# Attente d'une seconde avant de continuer le script
sleep 1
$NOVA_COMPUTE_EXEX
--config-file
$NOVA_CONFIG
& > /dev/null
echo "."
;;
status)
if [ -z "
\$
pid" ]; then
echo " nova-compute: STOPPED/EXITED" ;
else
echo " nova-compute: RUNNING PID:
\$
pid" ;
fi
echo "."
;;
*)
echo "Usage: /etc/init.d/
\$
NAME start|stop|restart" >&2
exit 1
;;
esac
exit 0
EOF
chmod
+x /etc/init.d/nova-compute
update-rc.d nova-compute defaults
/etc/init.d/nova-compute restart
>
/dev/null 2>&1
exit
0
software/openstack/templates/kvm-run.in
View file @
f4a371c6
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
# BEWARE: It will be overwritten automatically
# BEWARE: It will be overwritten automatically
# Echo client program
# Echo client program
import hashlib
import os
import os
import socket
import socket
import subprocess
import subprocess
import urllib
def getSocketStatus(host, port):
def getSocketStatus(host, port):
s = None
s = None
...
@@ -26,8 +28,19 @@ def getSocketStatus(host, port):
...
@@ -26,8 +28,19 @@ def getSocketStatus(host, port):
break
break
return s
return s
# create disk if doesn't exist
disk_path = '${:disk_path}'
disk_path = '${:disk_path}'
virtual_hard_drive_url = '${:virtual-hard-drive-url}'.strip()
virtual_hard_drive_md5_url = '${:virtual-hard-drive-md5-url}'.strip()
# Download existing hard drive if needed at first boot
if not os.path.exists(disk_path) and virtual_hard_drive_url != '':
urllib.urlretrieve(virtual_hard_drive_url, disk_path)
local_md5sum = md5Checksum(disk_path)
md5sum = urllib.urlopen(virtual_hard_drive_md5_url).read().strip()
if local_md5sum != md5sum:
os.remove(disk_path)
raise Exception('MD5 mismatch.')
# create disk if doesn't exist
if not os.path.exists(disk_path):
if not os.path.exists(disk_path):
subprocess.Popen(['${:qemu_img_path}', 'create' ,'-f', 'qcow2',
subprocess.Popen(['${:qemu_img_path}', 'create' ,'-f', 'qcow2',
disk_path, '${:disk_size}G'])
disk_path, '${:disk_size}G'])
...
...
software/openstack/templates/ssh-configure.py.in
0 → 100644
View file @
f4a371c6
#!${:python_path}
# BEWARE: This file is operated by slapgrid
# BEWARE: It will be overwritten automatically
# Echo client program
import os
import traceback
import sys
import time
pythonPath = []
eggs = '${:eggs-dir}'
for item in os.listdir(eggs):
path = os.path.join(eggs, item)
pythonPath.append(path)
sys.path[0:0] = pythonPath
import paramiko
check_ssh_args = ['${:ssh-check-script}']
password = '${:system-passwd}'
username = '${:system-user}'
port = ${:ssh-port}
hostname = '${:host-ip}'
ssh_run = os.path.join('${:nova-result}', 'nova-configure.log')
ssh_check = os.path.join('${:nova-result}', 'ssh_check.log')
nova_configure = '${:nova-configure}'
def getClient():
try:
client = paramiko.SSHClient()
client.load_system_host_keys()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
print '*** Connecting...'
client.connect(hostname, port, username, password)
return client
except Exception, e:
print "Could not connect to host... Will retry after a few minutes"
return None
if __name__ == '__main__':
client = None
while not client:
client = getClient()
time.sleep(5)
try:
#Write file configure.sh to use.
sftp = client.open_sftp()
result = sftp.put(nova_configure, 'configure.sh' )
print 'Nova configure copied successfully! File size: %s' % result.st_size
sftp.close()
#Install nova components and services
print "Installing nova..."
install_command = "echo %s | sudo -S /bin/sh configure.sh" % password
stdin, stdout, stderr = client.exec_command(install_command)
with open(ssh_run, 'a') as output:
output.write(stdout.read())
#Check nova service status
print "Checking nova service status..."
nova_command = 'echo %s | sudo -S /etc/init.d/nova-compute status' % password
stdin, stdout, stderr = client.exec_command(nova_command)
with open(ssh_check, 'a') as output:
output.write(stdout.read())
client.close()
except Exception, e:
print '*** Caught exception: %s: %s' % (e.__class__, e)
traceback.print_exc()
try:
client.close()
except:
pass
sys.exit(1)
\ No newline at end of file
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