Chapter 09/circuit-oneops-1-master/components/cookbooks/azure/libraries/storage_profile.rb
# This function will generate all possible storage account NAMES
# for current Resource Group.
This function will generate all possible storage account NAMES
for current Resource Group.
This function will generate all possible storage account NAMES for current Resource Group .
def generate_storage_account_names(storage_account_name)
      limit = 800/40
      storage_accounts = Array.new
      (1..limit).each do |index|
        if index < 10
          account_name =  "#{storage_account_name}0" + index.to_s
        else
          account_name =  "#{storage_account_name}" + index.to_s
        end
        storage_accounts[index-1] = account_name
      end
      return storage_accounts
    end
def generate_storage_account_names ( storage_account_name ) limit = 800 / 40 storage_accounts = Array . new ( 1 .. limit ) . each do | index | if index < 10 account_name = "#{storage_account_name}0" + index . to_s else account_name = "#{storage_account_name}" + index . to_s end storage_accounts [ index - 1 ] = account_name end return storage_accounts end
This function will generate all possible storage account NAMES
for current Resource Group.
This function will generate all possible storage account NAMES for current Resource Group .
# The max number of resources in a Resource Group is 800 # Microsoft guidelines is 40 Disks per storage account # to not affect performance # So the most storage accounts we could have per Resource Group is 800/40
storage_account_name
<not_specific>