Skip to content

Commit

Permalink
Longer timeout for stlinks in ONe
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Parak committed Aug 15, 2017
1 parent 6eb1cc1 commit be37272
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/lib/backends/opennebula/constants/storagelink.rb
Expand Up @@ -5,6 +5,9 @@ module Storagelink
# Pattern for matching IDs
ID_PATTERN = /^compute_(?<compute>\d+)_disk_(?<disk>\d+)$/

# Attach timeout
ATTACH_TIMEOUT = 120

# Attribute mapping hash for Core
ATTRIBUTES_CORE = {
'occi.core.id' => ->(ary) { "compute_#{ary.last['ID']}_disk_#{ary.first['DISK_ID']}" },
Expand Down
2 changes: 1 addition & 1 deletion app/lib/backends/opennebula/storagelink.rb
Expand Up @@ -62,7 +62,7 @@ def create(instance)
disks = Backends::Opennebula::Helpers::Counter.xml_elements(vm, 'TEMPLATE/DISK')

client(Errors::Backend::EntityCreateError) { vm.disk_attach disk_from(instance) }
wait_until(vm, 'RUNNING') do |nvm|
wait_until(vm, 'RUNNING', Constants::Storagelink::ATTACH_TIMEOUT) do |nvm|
unless Backends::Opennebula::Helpers::Counter.xml_elements(nvm, 'TEMPLATE/DISK') > disks
logger.error "Attaching IMAGE to VM[#{vm['ID']}] failed: #{vm['USER_TEMPLATE/ERROR']}"
raise Errors::Backend::EntityCreateError, 'Could not attach storage to compute'
Expand Down

0 comments on commit be37272

Please sign in to comment.