mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-23 05:04:56 +09:00
1 parent
cf04a8836a
commit
610cf051d7
2 files changed
+11
-1
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user