lib/fog/azurerm/requests/compute/create_availability_set.rb in fog-azure-rm-0.3.3 vs lib/fog/azurerm/requests/compute/create_availability_set.rb in fog-azure-rm-0.3.4
- old
+ new
@@ -8,14 +8,15 @@
location = availability_set_params[:location]
resource_group = availability_set_params[:resource_group]
fault_domain_count = availability_set_params[:platform_fault_domain_count]
update_domain_count = availability_set_params[:platform_update_domain_count]
use_managed_disk = availability_set_params[:use_managed_disk].nil? ? false : availability_set_params[:use_managed_disk]
+ tags = availability_set_params[:tags]
msg = "Creating Availability Set '#{name}' in #{location} region."
Fog::Logger.debug msg
- avail_set_params = get_availability_set_properties(location, fault_domain_count, update_domain_count, use_managed_disk)
+ avail_set_params = get_availability_set_properties(location, fault_domain_count, update_domain_count, use_managed_disk, tags)
begin
availability_set = @compute_mgmt_client.availability_sets.create_or_update(resource_group, name, avail_set_params)
rescue MsRestAzure::AzureOperationError => e
raise_azure_exception(e, msg)
@@ -23,15 +24,16 @@
Fog::Logger.debug "Availability Set #{name} created successfully."
availability_set
end
# create the properties object for creating availability sets
- def get_availability_set_properties(location, fault_domain_count, update_domain_count, use_managed_disk)
+ def get_availability_set_properties(location, fault_domain_count, update_domain_count, use_managed_disk, tags)
avail_set = Azure::ARM::Compute::Models::AvailabilitySet.new
avail_set.location = location
avail_set.sku = create_availability_set_sku(use_managed_disk)
avail_set.platform_fault_domain_count = fault_domain_count.nil? ? FAULT_DOMAIN_COUNT : fault_domain_count
avail_set.platform_update_domain_count = update_domain_count.nil? ? UPDATE_DOMAIN_COUNT : update_domain_count
+ avail_set.tags = tags
avail_set
end
def create_availability_set_sku(use_managed_disk)
sku = Azure::ARM::Compute::Models::Sku.new