mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-20 10:50:08 +03:00
(cherry picked from commit 610cf051d740aaf57f2f08db156b2fa797ce8548)
This commit is contained in:
parent
47675567a2
commit
222d1235ef
@ -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 })
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user