1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-20 10:50:08 +03:00

B #3389: Add pre_boot status (#3446)

(cherry picked from commit 610cf051d740aaf57f2f08db156b2fa797ce8548)
This commit is contained in:
Daniel Clavijo Coca 2019-06-21 02:26:39 -05:00 committed by Ruben S. Montero
parent 47675567a2
commit 222d1235ef
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 11 additions and 1 deletions

View File

@ -129,6 +129,8 @@ class Container
# Create a container without a base image
def create(wait: true, timeout: '')
@lxc['source'] = { 'type' => 'none' }
@lxc['config']['user.one_status'] = '0'
wait?(@client.post(CONTAINERS, @lxc), wait, timeout)
@lxc = @client.get("#{CONTAINERS}/#{name}")['metadata']
@ -204,7 +206,13 @@ class Container
#---------------------------------------------------------------------------
def start(options = {})
OpenNebula.log '--- Starting container ---'
change_state(__method__, options)
operation = change_state(__method__, options)
@lxc['config'].delete('user.one_status')
update
operation
end
def stop(options = { :timeout => 120 })

View File

@ -121,6 +121,8 @@ module LXD
state = 'p'
when 'stopped'
state = 'd'
state = '-' if container.config['user.one_status'] == '0'
when 'failure'
state = 'e'
else