Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/storage_profile.rb
#Calculate the index of the storage account name array
#based on the number of virtual machines created on the
#current subscription
Calculate the index of the storage account name array
based on the number of virtual machines created on the
current subscription
Calculate the index of the storage account name array based on the number of virtual machines created on the current subscription
def calculate_storage_index(storage_accounts, vm_count)
      increment = 40
      storage_account = 0
      vm_count += 1
      storage_count = storage_accounts.size - 1
      (0..storage_count).each do |storage_index|
        storage_account += increment
        if vm_count <= storage_account
          return storage_index
        end
      end
      return -1
    end
def calculate_storage_index ( storage_accounts , vm_count ) increment = 40 storage_account = 0 vm_count += 1 storage_count = storage_accounts . size - 1 ( 0 .. storage_count ) . each do | storage_index | storage_account += increment if vm_count <= storage_account return storage_index end end return - 1 end
Calculate the index of the storage account name array
based on the number of virtual machines created on the
current subscription
Calculate the index of the storage account name array based on the number of virtual machines created on the current subscription
storage_accounts
<not_specific>
vm_count
<not_specific>