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
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
bc1d0db9
Commit
bc1d0db9
authored
Oct 19, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kvm: add promise to check if qemu is correctly started
parent
287685eb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
5 deletions
+49
-5
software/kvm/common.cfg
software/kvm/common.cfg
+13
-3
software/kvm/instance-for-erp5testnode.cfg.in
software/kvm/instance-for-erp5testnode.cfg.in
+1
-0
software/kvm/instance-kvm.cfg.jinja2
software/kvm/instance-kvm.cfg.jinja2
+11
-1
software/kvm/instance.cfg.in
software/kvm/instance.cfg.in
+1
-0
software/kvm/software-for-erp5testnode.cfg
software/kvm/software-for-erp5testnode.cfg
+1
-1
software/kvm/template/kvm-controller-run.in
software/kvm/template/kvm-controller-run.in
+8
-0
software/kvm/template/qemu-is-ready.in
software/kvm/template/qemu-is-ready.in
+14
-0
No files found.
software/kvm/common.cfg
View file @
bc1d0db9
...
...
@@ -92,7 +92,7 @@ command =
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
md5sum =
92c62e050aac47097f5ca81cb7f2acec
md5sum =
110df709a7c8a5c749f93663f6ab0d28
output = ${buildout:directory}/template.cfg
mode = 0644
...
...
@@ -101,7 +101,7 @@ recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/instance-kvm.cfg.jinja2
mode = 644
md5sum =
f53c55c6a12c58baf650828c14ca171f
md5sum =
d09d37dc3bcf34da8d31b11215866b27
download-only = true
on-update = true
...
...
@@ -207,7 +207,7 @@ ignore-existing = true
url = ${:_profile_base_location_}/template/kvm-controller-run.in
mode = 644
filename = kvm-controller-run.in
md5sum =
b61ef9c54d912fdbfed3899fa985f79c
md5sum =
71afd2d13f6e56993ae413a168e012d7
download-only = true
on-update = true
...
...
@@ -231,6 +231,16 @@ md5sum = 822737e483864bf255ad1259237bef2a
download-only = true
on-update = true
[template-qemu-ready]
recipe = hexagonit.recipe.download
ignore-existing = true
url = ${:_profile_base_location_}/template/qemu-is-ready.in
mode = 644
filename = qemu-is-ready.in
md5sum = 0066fa0f5f3dd47bded5e5924df2550d
download-only = true
on-update = true
[file-download-script]
recipe = hexagonit.recipe.download
ignore-existing = true
...
...
software/kvm/instance-for-erp5testnode.cfg.in
View file @
bc1d0db9
...
...
@@ -63,6 +63,7 @@ context =
raw python_executable ${buildout:executable}
raw qemu_executable_location ${kvm:location}/bin/qemu-system-x86_64
raw qemu_img_executable_location ${kvm:location}/bin/qemu-img
raw qemu_start_promise_tpl ${template-qemu-ready:location}/${template-qemu-ready:filename}
raw sixtunnel_executable_location ${6tunnel:location}/bin/6tunnel
raw template_httpd_cfg ${template-httpd:rendered}
raw template_content ${template-content:location}/${template-content:filename}
...
...
software/kvm/instance-kvm.cfg.jinja2
View file @
bc1d0db9
...
...
@@ -65,6 +65,7 @@ bytes = 8
python-path = {{ python_executable }}
vnc-passwd = ${gen-passwd:passwd}
socket-path = ${directory:var}/qmp_socket
kvm-status-path = ${directory:var}/qemu-vm-is-ready
[kvm-parameter-dict]
python-path = {{ python_executable }}
...
...
@@ -212,6 +213,15 @@ input = inline:#!/bin/sh
output = ${directory:promises}/kvm-disk-image-corruption
mode = 700
[kvm-started-promise]
recipe = slapos.recipe.template:jinja2
template = {{ qemu_start_promise_tpl }}
rendered = ${directory:promises}/qemu-virtual-machine-is-ready
mode = 700
context =
raw dash {{ dash_executable_location }}
raw qemu_ready_path ${kvm-controller-parameter-dict:kvm-status-path}
raw qemu_service_log_file ${buildout:directory}/.${slap-connection:partition-id}_kvm.log
[novnc-instance]
recipe = slapos.cookbook:novnc
...
...
@@ -624,7 +634,7 @@ parts =
kvm-disk-image-corruption-promise
websockify-sighandler
novnc-promise
# kvm-monitor
kvm-started-promise
cron
cron-entry-logrotate
frontend-promise
...
...
software/kvm/instance.cfg.in
View file @
bc1d0db9
...
...
@@ -96,6 +96,7 @@ context =
raw python_executable ${buildout:executable}
raw qemu_executable_location ${kvm:location}/bin/qemu-system-x86_64
raw qemu_img_executable_location ${kvm:location}/bin/qemu-img
raw qemu_start_promise_tpl ${template-qemu-ready:location}/${template-qemu-ready:filename}
raw sixtunnel_executable_location ${6tunnel:location}/bin/6tunnel
raw template_httpd_cfg ${template-httpd:rendered}
raw template_content ${template-content:location}/${template-content:filename}
...
...
software/kvm/software-for-erp5testnode.cfg
View file @
bc1d0db9
...
...
@@ -5,6 +5,6 @@ extends = development.cfg
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-for-erp5testnode.cfg.in
md5sum =
71b730997a6e3ce7f0579901401eab9c
md5sum =
61414eefb6641f74d5f2b4ffc23af393
output = ${buildout:directory}/template.cfg
mode = 0644
\ No newline at end of file
software/kvm/template/kvm-controller-run.in
View file @
bc1d0db9
...
...
@@ -5,11 +5,16 @@
# Echo client program
import socket
import time
import os
# XXX: to be factored with slapos.toolbox qemu qmp wrapper.
socket_path = '{{ parameter_dict.get("socket-path") }}'
vnc_password = '{{ parameter_dict.get("vnc-passwd") }}'
status_path = '{{ parameter_dict.get("kvm-status-path") }}'
if os.path.exists(status_path):
os.unlink(status_path)
# Connect to KVM qmp socket
so = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
...
...
@@ -35,3 +40,6 @@ data = so.recv(1024)
# Finish
so.close()
with open(status_path, 'w') as status_file:
status_file.write("OK")
software/kvm/template/qemu-is-ready.in
0 → 100644
View file @
bc1d0db9
#!{{ dash }}
if [ -f "{{ qemu_ready_path }}" ]; then
echo "VM correctly started."
else
log_file="{{ qemu_service_log_file }}"
>&2 echo "Qemu process is not correctly started."
if [ -f "$log_file" ]; then
>&2 echo "** Latest ouput logs **"
>&2 echo
>&2 echo "$(tail $log_file)"
exit 1
fi
fi
\ 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