F #4089: Fix minor bugs (#4568)

This commit is contained in:
Christian González authored and GitHub committed 2020-04-21 16:25:58 +02:00
1 parent 472fb883f4
commit 4269234441
7 files changed
+23 -13

No files matched your search

+9 -3
View File
@@ -468,17 +468,23 @@ VM_MAD = [
#-------------------------------------------------------------------------------
# Firecracker Virtualization Driver Manager Configuration
#
# -r number of retries when monitoring a host
# -t number of threads, i.e. number of hosts monitored at the same time
# -l <actions[=command_name]> actions executed locally, command can be
# overridden for each action.
# Valid actions: deploy, shutdown, cancel, save, restore, migrate, poll
# An example: "-l migrate=migrate_local,save"
# -p more than one action per host in parallel, needs support from hypervisor
# -s <shell> to execute remote commands, bash by default
# -w Timeout in seconds to execute external commands (default unlimited)
#-------------------------------------------------------------------------------
VM_MAD = [
NAME = "firecracker",
SUNSTONE_NAME = "Firecracker",
EXECUTABLE = "one_vmm_exec",
ARGUMENTS = "-t 15 -r 0 firecracker",
# DEFAULT = "vmm_exec/vmm_exec_lxd.conf",
TYPE = "xml",
KEEP_SNAPSHOTS = "no",
IMPORTED_VMS_ACTIONS = "terminate, terminate-hard, reboot, reboot-hard, poweroff, poweroff-hard, suspend, resume, stop, delete, nic-attach, nic-detach"
]
#-------------------------------------------------------------------------------
+7 -3
View File
@@ -34,7 +34,7 @@ module Firecracker
def self.flush_metrics(uuid)
begin
socket = "/srv/jailer/firecracker/#{uuid}/root/api.socket"
socket = socket_path(uuid)
client = FirecrackerClient.new(socket)
data = '{"action_type": "FlushMetrics"}'
@@ -64,7 +64,7 @@ module Firecracker
def self.machine_config(uuid)
begin
socket = "/srv/jailer/firecracker/#{uuid}/root/api.socket"
socket = socket_path(uuid)
client = FirecrackerClient.new(socket)
response = client.get('machine-config')
@@ -87,7 +87,7 @@ module Firecracker
def self.general_info(uuid)
begin
socket = "/srv/jailer/firecracker/#{uuid}/root/api.socket"
socket = socket_path(uuid)
client = FirecrackerClient.new(socket)
response = client.get('')
@@ -114,6 +114,10 @@ module Firecracker
vm_info.merge!(general_info(uuid))
end
def self.socket_path(uuid)
"/srv/jailer/firecracker/#{uuid}/root/run/firecracker.socket"
end
end
#-------------------------------------------------------------------------------
@@ -18,7 +18,7 @@
# VNC Options
################################################################################
#
# Options to customize the VNC access to the container:
# Options to customize the VNC access to the microVM:
# - :width: of the terminal
# - :height: of the terminal
# - :timeout: seconds to close the terminal if no input has been received
@@ -57,4 +57,4 @@
:cgroup_location: /sys/fs/cgroup
#
# Timeout to wait a cgroup to be empty after shutdown/cancel a microVM
:cgroup_delete_timeout: 60
:cgroup_delete_timeout: 60
+1 -1
View File
@@ -30,7 +30,7 @@ xml = STDIN.read
died = false
begin
socket = "/srv/jailer/firecracker/one-#{vm_id}/root/api.socket"
socket = "/srv/jailer/firecracker/one-#{vm_id}/root/run/firecracker.socket"
client = FirecrackerClient.new(socket)
rescue StandardError
died = true
@@ -45,7 +45,7 @@ ROOTFS_PATH="/srv/jailer/firecracker/$VM_NAME/root"
# Remove Firecracker residual files
rm -rf "$ROOTFS_PATH/dev"
rm -f "$ROOTFS_PATH/api.socket"
rm -rf "$ROOTFS_PATH/run"
rm -f "$ROOTFS_PATH/firecracker"
# Unmount VM directory (if needed)
+1 -1
View File
@@ -62,7 +62,7 @@ e = nil
error = false
template.elements.each(XPATH_NICS) do |nic_element|
nic_id = Integer(nic_element.elements['//NIC_ID'].text)
nic_id = Integer(nic_element.elements['NIC_ID'].text)
if_name = "#{deploy_id}-#{nic_id}"
# check if interface is already defined
+2 -2
View File
@@ -56,8 +56,8 @@ end
rc = nil
template.elements.each(XPATH_NICS) do |nic_element|
nic_id = Integer(nic_element.elements['//NIC_ID'].text)
bridge = nic_element.elements['//BRIDGE'].text
nic_id = Integer(nic_element.elements['NIC_ID'].text)
bridge = nic_element.elements['BRIDGE'].text
if_name = "#{deploy_id}-#{nic_id}"