public void TestVMScaleSetWithnNsg()
        {
            using (MockContext context = MockContext.Start(this.GetType()))
            {
                EnsureClientsInitialized(context);

                ImageReference imageRef = GetPlatformVMImage(useWindowsImage: true);

                // Create resource group
                string rgName             = TestUtilities.GenerateName(TestPrefix) + 1;
                var    vmssName           = TestUtilities.GenerateName("vmss");
                var    dnsname            = TestUtilities.GenerateName("dnsname");
                var    nsgname            = TestUtilities.GenerateName("nsg");
                string storageAccountName = TestUtilities.GenerateName(TestPrefix);
                VirtualMachineScaleSet inputVMScaleSet;

                bool passed = false;
                try
                {
                    var storageAccountOutput = CreateStorageAccount(rgName, storageAccountName);
                    var vnetResponse         = CreateVNETWithSubnets(rgName, 2);
                    var vmssSubnet           = vnetResponse.Subnets[1];
                    var nsg = CreateNsg(rgName, nsgname);

                    Microsoft.Azure.Management.Compute.Models.SubResource nsgId = new Microsoft.Azure.Management.Compute.Models.SubResource()
                    {
                        Id = nsg.Id
                    };

                    VirtualMachineScaleSet vmScaleSet = CreateVMScaleSet_NoAsyncTracking(
                        rgName: rgName,
                        vmssName: vmssName,
                        storageAccount: storageAccountOutput,
                        imageRef: imageRef,
                        inputVMScaleSet: out inputVMScaleSet,
                        vmScaleSetCustomizer:
                        (virtualMachineScaleSet) =>
                        virtualMachineScaleSet.VirtualMachineProfile.NetworkProfile
                        .NetworkInterfaceConfigurations[0].NetworkSecurityGroup = nsgId,
                        createWithPublicIpAddress: false,
                        subnet: vmssSubnet);

                    var vmss = m_CrpClient.VirtualMachineScaleSets.Get(rgName, vmssName);
                    Assert.NotNull(vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].NetworkSecurityGroup);
                    Assert.Equal(vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].NetworkSecurityGroup.Id, nsg.Id, StringComparer.OrdinalIgnoreCase);

                    var getNsgResponse = m_NrpClient.NetworkSecurityGroups.Get(rgName, nsg.Name);
                    Assert.Equal(2, getNsgResponse.NetworkInterfaces.Count);

                    passed = true;
                }
                finally
                {
                    m_ResourcesClient.ResourceGroups.DeleteIfExists(rgName);
                }

                Assert.True(passed);
            }
        }
        private void Run()
        {
            WriteWarning("New-AzureRmImageConfig: A property of the output of this cmdlet will change in an upcoming breaking change release. " +
                         "The StorageAccountType property for a DataDisk will return Standard_LRS and Premium_LRS");

            // SourceVirtualMachine
            Microsoft.Azure.Management.Compute.Models.SubResource vSourceVirtualMachine = null;

            // StorageProfile
            Microsoft.Azure.Management.Compute.Models.ImageStorageProfile vStorageProfile = null;

            if (this.MyInvocation.BoundParameters.ContainsKey("SourceVirtualMachineId"))
            {
                if (vSourceVirtualMachine == null)
                {
                    vSourceVirtualMachine = new Microsoft.Azure.Management.Compute.Models.SubResource();
                }
                vSourceVirtualMachine.Id = this.SourceVirtualMachineId;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("OsDisk"))
            {
                if (vStorageProfile == null)
                {
                    vStorageProfile = new Microsoft.Azure.Management.Compute.Models.ImageStorageProfile();
                }
                vStorageProfile.OsDisk = this.OsDisk;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("DataDisk"))
            {
                if (vStorageProfile == null)
                {
                    vStorageProfile = new Microsoft.Azure.Management.Compute.Models.ImageStorageProfile();
                }
                vStorageProfile.DataDisks = this.DataDisk;
            }

            if (vStorageProfile == null)
            {
                vStorageProfile = new Microsoft.Azure.Management.Compute.Models.ImageStorageProfile();
            }
            vStorageProfile.ZoneResilient = this.ZoneResilient.IsPresent;

            var vImage = new PSImage
            {
                Location             = this.MyInvocation.BoundParameters.ContainsKey("Location") ? this.Location : null,
                Tags                 = this.MyInvocation.BoundParameters.ContainsKey("Tag") ? this.Tag.Cast <DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
                SourceVirtualMachine = vSourceVirtualMachine,
                StorageProfile       = vStorageProfile,
            };

            WriteObject(vImage);
        }
        public void TestVMScaleSetWithApplciationGateway()
        {
            using (MockContext context = MockContext.Start(this.GetType()))
            {
                EnsureClientsInitialized(context);

                ImageReference imageRef = GetPlatformVMImage(useWindowsImage: true);

                // Create resource group
                string rgName             = TestUtilities.GenerateName(TestPrefix) + 1;
                var    vmssName           = TestUtilities.GenerateName("vmss");
                string storageAccountName = TestUtilities.GenerateName(TestPrefix);
                VirtualMachineScaleSet inputVMScaleSet;

                bool passed = false;
                try
                {
                    var storageAccountOutput = CreateStorageAccount(rgName, storageAccountName);
                    var vnetResponse         = CreateVNETWithSubnets(rgName, 2);
                    var gatewaySubnet        = vnetResponse.Subnets[0];
                    var vmssSubnet           = vnetResponse.Subnets[1];
                    ApplicationGateway appgw = CreateApplicationGateway(rgName, gatewaySubnet);
                    Microsoft.Azure.Management.Compute.Models.SubResource backendAddressPool = new Microsoft.Azure.Management.Compute.Models.SubResource()
                    {
                        Id = appgw.BackendAddressPools[0].Id
                    };

                    VirtualMachineScaleSet vmScaleSet = CreateVMScaleSet_NoAsyncTracking(
                        rgName: rgName,
                        vmssName: vmssName,
                        storageAccount: storageAccountOutput,
                        imageRef: imageRef,
                        inputVMScaleSet: out inputVMScaleSet,
                        vmScaleSetCustomizer:
                        (virtualMachineScaleSet) =>
                        virtualMachineScaleSet.VirtualMachineProfile.NetworkProfile
                        .NetworkInterfaceConfigurations[0].IpConfigurations[0]
                        .ApplicationGatewayBackendAddressPools.Add(backendAddressPool),
                        createWithPublicIpAddress: false,
                        subnet: vmssSubnet);

                    var getGwResponse = m_NrpClient.ApplicationGateways.Get(rgName, appgw.Name);
                    Assert.True(2 == getGwResponse.BackendAddressPools[0].BackendIPConfigurations.Count);
                    passed = true;
                }
                finally
                {
                    m_ResourcesClient.ResourceGroups.DeleteIfExists(rgName);
                }

                Assert.True(passed);
            }
        }
Пример #4
0
        private void Run()
        {
            // SourceVirtualMachine
            Microsoft.Azure.Management.Compute.Models.SubResource vSourceVirtualMachine = null;

            // StorageProfile
            Microsoft.Azure.Management.Compute.Models.ImageStorageProfile vStorageProfile = null;

            if (this.MyInvocation.BoundParameters.ContainsKey("SourceVirtualMachineId"))
            {
                if (vSourceVirtualMachine == null)
                {
                    vSourceVirtualMachine = new Microsoft.Azure.Management.Compute.Models.SubResource();
                }
                vSourceVirtualMachine.Id = this.SourceVirtualMachineId;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("OsDisk"))
            {
                if (vStorageProfile == null)
                {
                    vStorageProfile = new Microsoft.Azure.Management.Compute.Models.ImageStorageProfile();
                }
                vStorageProfile.OsDisk = this.OsDisk;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("DataDisk"))
            {
                if (vStorageProfile == null)
                {
                    vStorageProfile = new Microsoft.Azure.Management.Compute.Models.ImageStorageProfile();
                }
                vStorageProfile.DataDisks = this.DataDisk;
            }

            if (vStorageProfile == null)
            {
                vStorageProfile = new Microsoft.Azure.Management.Compute.Models.ImageStorageProfile();
            }
            vStorageProfile.ZoneResilient = this.ZoneResilient.IsPresent;

            var vImage = new PSImage
            {
                Location             = this.MyInvocation.BoundParameters.ContainsKey("Location") ? this.Location : null,
                Tags                 = this.MyInvocation.BoundParameters.ContainsKey("Tag") ? this.Tag.Cast <DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value) : null,
                SourceVirtualMachine = vSourceVirtualMachine,
                StorageProfile       = vStorageProfile,
            };

            WriteObject(vImage);
        }
Пример #5
0
        protected override void ProcessRecord()
        {
            var vIpConfigurations = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIPConfiguration();

            // Subnet
            vIpConfigurations.Subnet = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();

            // ApplicationGatewayBackendAddressPools
            vIpConfigurations.ApplicationGatewayBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();

            // LoadBalancerBackendAddressPools
            vIpConfigurations.LoadBalancerBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();

            // LoadBalancerInboundNatPools
            vIpConfigurations.LoadBalancerInboundNatPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();

            vIpConfigurations.Name      = this.Name;
            vIpConfigurations.Id        = this.Id;
            vIpConfigurations.Subnet.Id = this.SubnetId;
            if (this.ApplicationGatewayBackendAddressPoolsId != null)
            {
                foreach (var element in this.ApplicationGatewayBackendAddressPoolsId)
                {
                    var vApplicationGatewayBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vApplicationGatewayBackendAddressPools.Id = element;
                    vIpConfigurations.ApplicationGatewayBackendAddressPools.Add(vApplicationGatewayBackendAddressPools);
                }
            }

            if (this.LoadBalancerBackendAddressPoolsId != null)
            {
                foreach (var element in this.LoadBalancerBackendAddressPoolsId)
                {
                    var vLoadBalancerBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerBackendAddressPools.Id = element;
                    vIpConfigurations.LoadBalancerBackendAddressPools.Add(vLoadBalancerBackendAddressPools);
                }
            }

            if (this.LoadBalancerInboundNatPoolsId != null)
            {
                foreach (var element in this.LoadBalancerInboundNatPoolsId)
                {
                    var vLoadBalancerInboundNatPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerInboundNatPools.Id = element;
                    vIpConfigurations.LoadBalancerInboundNatPools.Add(vLoadBalancerInboundNatPools);
                }
            }

            WriteObject(vIpConfigurations);
        }
        private void Run()
        {
            // SourceVirtualMachine
            Microsoft.Azure.Management.Compute.Models.SubResource vSourceVirtualMachine = null;

            // StorageProfile
            Microsoft.Azure.Management.Compute.Models.ImageStorageProfile vStorageProfile = null;

            if (this.SourceVirtualMachineId != null)
            {
                if (vSourceVirtualMachine == null)
                {
                    vSourceVirtualMachine = new Microsoft.Azure.Management.Compute.Models.SubResource();
                }
                vSourceVirtualMachine.Id = this.SourceVirtualMachineId;
            }

            if (this.OsDisk != null)
            {
                if (vStorageProfile == null)
                {
                    vStorageProfile = new Microsoft.Azure.Management.Compute.Models.ImageStorageProfile();
                }
                vStorageProfile.OsDisk = this.OsDisk;
            }

            if (this.DataDisk != null)
            {
                if (vStorageProfile == null)
                {
                    vStorageProfile = new Microsoft.Azure.Management.Compute.Models.ImageStorageProfile();
                }
                vStorageProfile.DataDisks = this.DataDisk;
            }


            var vImage = new PSImage
            {
                Location             = this.Location,
                Tags                 = (this.Tag == null) ? null : this.Tag.Cast <DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value),
                SourceVirtualMachine = vSourceVirtualMachine,
                StorageProfile       = vStorageProfile,
            };

            WriteObject(vImage);
        }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the VirtualMachineScaleSet class.
 /// </summary>
 /// <param name="location">Resource location</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="sku">The virtual machine scale set sku.</param>
 /// <param name="plan">Specifies information about the marketplace
 /// image used to create the virtual machine. This element is only used
 /// for marketplace images. Before you can use a marketplace image from
 /// an API, you must enable the image for programmatic use.  In the
 /// Azure portal, find the marketplace image that you want to use and
 /// then click **Want to deploy programmatically, Get Started -&gt;**.
 /// Enter any required information and then click **Save**.</param>
 /// <param name="upgradePolicy">The upgrade policy.</param>
 /// <param name="automaticRepairsPolicy">Policy for automatic
 /// repairs.</param>
 /// <param name="virtualMachineProfile">The virtual machine
 /// profile.</param>
 /// <param name="provisioningState">The provisioning state, which only
 /// appears in the response.</param>
 /// <param name="overprovision">Specifies whether the Virtual Machine
 /// Scale Set should be overprovisioned.</param>
 /// <param name="doNotRunExtensionsOnOverprovisionedVMs">When
 /// Overprovision is enabled, extensions are launched only on the
 /// requested number of VMs which are finally kept. This property will
 /// hence ensure that the extensions do not run on the extra
 /// overprovisioned VMs.</param>
 /// <param name="uniqueId">Specifies the ID which uniquely identifies a
 /// Virtual Machine Scale Set.</param>
 /// <param name="singlePlacementGroup">When true this limits the scale
 /// set to a single placement group, of max size 100 virtual machines.
 /// NOTE: If singlePlacementGroup is true, it may be modified to false.
 /// However, if singlePlacementGroup is false, it may not be modified
 /// to true.</param>
 /// <param name="zoneBalance">Whether to force strictly even Virtual
 /// Machine distribution cross x-zones in case there is zone
 /// outage.</param>
 /// <param name="platformFaultDomainCount">Fault Domain count for each
 /// placement group.</param>
 /// <param name="proximityPlacementGroup">Specifies information about
 /// the proximity placement group that the virtual machine scale set
 /// should be assigned to. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2018-04-01.</param>
 /// <param name="hostGroup">Specifies information about the dedicated
 /// host group that the virtual machine scale set resides in.
 /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2020-06-01.</param>
 /// <param name="additionalCapabilities">Specifies additional
 /// capabilities enabled or disabled on the Virtual Machines in the
 /// Virtual Machine Scale Set. For instance: whether the Virtual
 /// Machines have the capability to support attaching managed data
 /// disks with UltraSSD_LRS storage account type.</param>
 /// <param name="scaleInPolicy">Specifies the scale-in policy that
 /// decides which virtual machines are chosen for removal when a
 /// Virtual Machine Scale Set is scaled-in.</param>
 /// <param name="orchestrationMode">Specifies the orchestration mode
 /// for the virtual machine scale set. Possible values include:
 /// 'Uniform', 'Flexible'</param>
 /// <param name="spotRestorePolicy">Specifies the Spot Restore
 /// properties for the virtual machine scale set.</param>
 /// <param name="identity">The identity of the virtual machine scale
 /// set, if configured.</param>
 /// <param name="zones">The virtual machine scale set zones. NOTE:
 /// Availability zones can only be set when you create the scale
 /// set</param>
 /// <param name="extendedLocation">The extended location of the Virtual
 /// Machine Scale Set.</param>
 public VirtualMachineScaleSet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), AutomaticRepairsPolicy automaticRepairsPolicy = default(AutomaticRepairsPolicy), VirtualMachineScaleSetVMProfile virtualMachineProfile = default(VirtualMachineScaleSetVMProfile), string provisioningState = default(string), bool?overprovision = default(bool?), bool?doNotRunExtensionsOnOverprovisionedVMs = default(bool?), string uniqueId = default(string), bool?singlePlacementGroup = default(bool?), bool?zoneBalance = default(bool?), int?platformFaultDomainCount = default(int?), SubResource proximityPlacementGroup = default(SubResource), SubResource hostGroup = default(SubResource), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), ScaleInPolicy scaleInPolicy = default(ScaleInPolicy), string orchestrationMode = default(string), SpotRestorePolicy spotRestorePolicy = default(SpotRestorePolicy), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList <string> zones = default(IList <string>), ExtendedLocation extendedLocation = default(ExtendedLocation))
     : base(location, id, name, type, tags)
 {
     Sku                    = sku;
     Plan                   = plan;
     UpgradePolicy          = upgradePolicy;
     AutomaticRepairsPolicy = automaticRepairsPolicy;
     VirtualMachineProfile  = virtualMachineProfile;
     ProvisioningState      = provisioningState;
     Overprovision          = overprovision;
     DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs;
     UniqueId                 = uniqueId;
     SinglePlacementGroup     = singlePlacementGroup;
     ZoneBalance              = zoneBalance;
     PlatformFaultDomainCount = platformFaultDomainCount;
     ProximityPlacementGroup  = proximityPlacementGroup;
     HostGroup                = hostGroup;
     AdditionalCapabilities   = additionalCapabilities;
     ScaleInPolicy            = scaleInPolicy;
     OrchestrationMode        = orchestrationMode;
     SpotRestorePolicy        = spotRestorePolicy;
     Identity                 = identity;
     Zones            = zones;
     ExtendedLocation = extendedLocation;
     CustomInit();
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the VirtualMachine class.
 /// </summary>
 /// <param name="location">Resource location</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="plan">Specifies information about the marketplace
 /// image used to create the virtual machine. This element is only used
 /// for marketplace images. Before you can use a marketplace image from
 /// an API, you must enable the image for programmatic use.  In the
 /// Azure portal, find the marketplace image that you want to use and
 /// then click **Want to deploy programmatically, Get Started -&gt;**.
 /// Enter any required information and then click **Save**.</param>
 /// <param name="hardwareProfile">Specifies the hardware settings for
 /// the virtual machine.</param>
 /// <param name="storageProfile">Specifies the storage settings for the
 /// virtual machine disks.</param>
 /// <param name="additionalCapabilities">Specifies additional
 /// capabilities enabled or disabled on the virtual machine.</param>
 /// <param name="osProfile">Specifies the operating system settings
 /// used while creating the virtual machine. Some of the settings
 /// cannot be changed once VM is provisioned.</param>
 /// <param name="networkProfile">Specifies the network interfaces of
 /// the virtual machine.</param>
 /// <param name="securityProfile">Specifies the Security related
 /// profile settings for the virtual machine.</param>
 /// <param name="diagnosticsProfile">Specifies the boot diagnostic
 /// settings state. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2015-06-15.</param>
 /// <param name="availabilitySet">Specifies information about the
 /// availability set that the virtual machine should be assigned to.
 /// Virtual machines specified in the same availability set are
 /// allocated to different nodes to maximize availability. For more
 /// information about availability sets, see [Availability sets
 /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).
 /// &lt;br&gt;&lt;br&gt; For more information on Azure planned
 /// maintenance, see [Maintenance and updates for Virtual Machines in
 /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)
 /// &lt;br&gt;&lt;br&gt; Currently, a VM can only be added to
 /// availability set at creation time. The availability set to which
 /// the VM is being added should be under the same resource group as
 /// the availability set resource. An existing VM cannot be added to an
 /// availability set. &lt;br&gt;&lt;br&gt;This property cannot exist
 /// along with a non-null properties.virtualMachineScaleSet
 /// reference.</param>
 /// <param name="virtualMachineScaleSet">Specifies information about
 /// the virtual machine scale set that the virtual machine should be
 /// assigned to. Virtual machines specified in the same virtual machine
 /// scale set are allocated to different nodes to maximize
 /// availability. Currently, a VM can only be added to virtual machine
 /// scale set at creation time. An existing VM cannot be added to a
 /// virtual machine scale set. &lt;br&gt;&lt;br&gt;This property cannot
 /// exist along with a non-null properties.availabilitySet reference.
 /// &lt;br&gt;&lt;br&gt;Minimum api‐version: 2019‐03‐01</param>
 /// <param name="proximityPlacementGroup">Specifies information about
 /// the proximity placement group that the virtual machine should be
 /// assigned to. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2018-04-01.</param>
 /// <param name="priority">Specifies the priority for the virtual
 /// machine. &lt;br&gt;&lt;br&gt;Minimum api-version: 2019-03-01.
 /// Possible values include: 'Regular', 'Low', 'Spot'</param>
 /// <param name="evictionPolicy">Specifies the eviction policy for the
 /// Azure Spot virtual machine and Azure Spot scale set.
 /// &lt;br&gt;&lt;br&gt;For Azure Spot virtual machines, both
 /// 'Deallocate' and 'Delete' are supported and the minimum api-version
 /// is 2019-03-01. &lt;br&gt;&lt;br&gt;For Azure Spot scale sets, both
 /// 'Deallocate' and 'Delete' are supported and the minimum api-version
 /// is 2017-10-30-preview. Possible values include: 'Deallocate',
 /// 'Delete'</param>
 /// <param name="billingProfile">Specifies the billing related details
 /// of a Azure Spot virtual machine. &lt;br&gt;&lt;br&gt;Minimum
 /// api-version: 2019-03-01.</param>
 /// <param name="host">Specifies information about the dedicated host
 /// that the virtual machine resides in. &lt;br&gt;&lt;br&gt;Minimum
 /// api-version: 2018-10-01.</param>
 /// <param name="hostGroup">Specifies information about the dedicated
 /// host group that the virtual machine resides in.
 /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2020-06-01.
 /// &lt;br&gt;&lt;br&gt;NOTE: User cannot specify both host and
 /// hostGroup properties.</param>
 /// <param name="provisioningState">The provisioning state, which only
 /// appears in the response.</param>
 /// <param name="instanceView">The virtual machine instance
 /// view.</param>
 /// <param name="licenseType">Specifies that the image or disk that is
 /// being used was licensed on-premises. &lt;br&gt;&lt;br&gt; Possible
 /// values for Windows Server operating system are:
 /// &lt;br&gt;&lt;br&gt; Windows_Client &lt;br&gt;&lt;br&gt;
 /// Windows_Server &lt;br&gt;&lt;br&gt; Possible values for Linux
 /// Server operating system are: &lt;br&gt;&lt;br&gt; RHEL_BYOS (for
 /// RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS (for SUSE)
 /// &lt;br&gt;&lt;br&gt; For more information, see [Azure Hybrid Use
 /// Benefit for Windows
 /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
 /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for Linux
 /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
 /// &lt;br&gt;&lt;br&gt; Minimum api-version: 2015-06-15</param>
 /// <param name="vmId">Specifies the VM unique ID which is a 128-bits
 /// identifier that is encoded and stored in all Azure IaaS VMs SMBIOS
 /// and can be read using platform BIOS commands.</param>
 /// <param name="extensionsTimeBudget">Specifies the time alloted for
 /// all extensions to start. The time duration should be between 15
 /// minutes and 120 minutes (inclusive) and should be specified in ISO
 /// 8601 format. The default value is 90 minutes (PT1H30M).
 /// &lt;br&gt;&lt;br&gt; Minimum api-version: 2020-06-01</param>
 /// <param name="platformFaultDomain">Specifies the scale set logical
 /// fault domain into which the Virtual Machine will be created. By
 /// default, the Virtual Machine will by automatically assigned to a
 /// fault domain that best maintains balance across available fault
 /// domains.&lt;br&gt;&lt;li&gt;This is applicable only if the
 /// 'virtualMachineScaleSet' property of this Virtual Machine is
 /// set.&lt;li&gt;The Virtual Machine Scale Set that is referenced,
 /// must have 'platformFaultDomainCount' &amp;gt; 1.&lt;li&gt;This
 /// property cannot be updated once the Virtual Machine is
 /// created.&lt;li&gt;Fault domain assignment can be viewed in the
 /// Virtual Machine Instance View.&lt;br&gt;&lt;br&gt;Minimum
 /// api‐version: 2020‐12‐01</param>
 /// <param name="scheduledEventsProfile">Specifies Scheduled Event
 /// related configurations.</param>
 /// <param name="userData">UserData for the VM, which must be base-64
 /// encoded. Customer should not pass any secrets in here.
 /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2021-03-01</param>
 /// <param name="capacityReservation">Specifies information about the
 /// capacity reservation that is used to allocate virtual machine.
 /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2021-04-01.</param>
 /// <param name="applicationProfile">Specifies the gallery applications
 /// that should be made available to the VM/VMSS</param>
 /// <param name="timeCreated">Specifies the time at which the Virtual
 /// Machine resource was created.&lt;br&gt;&lt;br&gt;Minimum
 /// api-version: 2021-11-01.</param>
 /// <param name="resources">The virtual machine child extension
 /// resources.</param>
 /// <param name="identity">The identity of the virtual machine, if
 /// configured.</param>
 /// <param name="zones">The virtual machine zones.</param>
 /// <param name="extendedLocation">The extended location of the Virtual
 /// Machine.</param>
 public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int?platformFaultDomain = default(int?), ScheduledEventsProfile scheduledEventsProfile = default(ScheduledEventsProfile), string userData = default(string), CapacityReservationProfile capacityReservation = default(CapacityReservationProfile), ApplicationProfile applicationProfile = default(ApplicationProfile), System.DateTime?timeCreated = default(System.DateTime?), IList <VirtualMachineExtension> resources = default(IList <VirtualMachineExtension>), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList <string> zones = default(IList <string>), ExtendedLocation extendedLocation = default(ExtendedLocation))
     : base(location, id, name, type, tags)
 {
     Plan                    = plan;
     HardwareProfile         = hardwareProfile;
     StorageProfile          = storageProfile;
     AdditionalCapabilities  = additionalCapabilities;
     OsProfile               = osProfile;
     NetworkProfile          = networkProfile;
     SecurityProfile         = securityProfile;
     DiagnosticsProfile      = diagnosticsProfile;
     AvailabilitySet         = availabilitySet;
     VirtualMachineScaleSet  = virtualMachineScaleSet;
     ProximityPlacementGroup = proximityPlacementGroup;
     Priority                = priority;
     EvictionPolicy          = evictionPolicy;
     BillingProfile          = billingProfile;
     Host                    = host;
     HostGroup               = hostGroup;
     ProvisioningState       = provisioningState;
     InstanceView            = instanceView;
     LicenseType             = licenseType;
     VmId                    = vmId;
     ExtensionsTimeBudget    = extensionsTimeBudget;
     PlatformFaultDomain     = platformFaultDomain;
     ScheduledEventsProfile  = scheduledEventsProfile;
     UserData                = userData;
     CapacityReservation     = capacityReservation;
     ApplicationProfile      = applicationProfile;
     TimeCreated             = timeCreated;
     Resources               = resources;
     Identity                = identity;
     Zones                   = zones;
     ExtendedLocation        = extendedLocation;
     CustomInit();
 }
Пример #9
0
 /// <summary>
 /// Initializes a new instance of the KeyVaultKeyReference class.
 /// </summary>
 public KeyVaultKeyReference(string keyUrl, SubResource sourceVault)
 {
     KeyUrl      = keyUrl;
     SourceVault = sourceVault;
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the
 /// LoadBalancerFrontendIPConfigurationProperties class.
 /// </summary>
 /// <param name="publicIPAddress">The reference to the public ip
 /// address resource.</param>
 /// <param name="subnet">The reference to the virtual network subnet
 /// resource.</param>
 /// <param name="privateIPAddress">The virtual network private IP
 /// address of the IP configuration.</param>
 public LoadBalancerFrontendIPConfigurationProperties(SubResource publicIPAddress = default(SubResource), SubResource subnet = default(SubResource), string privateIPAddress = default(string))
 {
     PublicIPAddress  = publicIPAddress;
     Subnet           = subnet;
     PrivateIPAddress = privateIPAddress;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the
 /// VirtualMachineScaleSetPublicIPAddressConfiguration class.
 /// </summary>
 /// <param name="name">The publicIP address configuration name.</param>
 /// <param name="idleTimeoutInMinutes">The idle timeout of the public
 /// IP address.</param>
 /// <param name="dnsSettings">The dns settings to be applied on the
 /// publicIP addresses .</param>
 /// <param name="ipTags">The list of IP tags associated with the public
 /// IP address.</param>
 /// <param name="publicIPPrefix">The PublicIPPrefix from which to
 /// allocate publicIP addresses.</param>
 /// <param name="publicIPAddressVersion">Available from Api-Version
 /// 2019-07-01 onwards, it represents whether the specific
 /// ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible
 /// values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4',
 /// 'IPv6'</param>
 /// <param name="deleteOption">Specify what happens to the public IP
 /// when the VM is deleted. Possible values include: 'Delete',
 /// 'Detach'</param>
 public VirtualMachineScaleSetPublicIPAddressConfiguration(string name, int?idleTimeoutInMinutes = default(int?), VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings), IList <VirtualMachineScaleSetIpTag> ipTags = default(IList <VirtualMachineScaleSetIpTag>), SubResource publicIPPrefix = default(SubResource), string publicIPAddressVersion = default(string), string deleteOption = default(string), PublicIPAddressSku sku = default(PublicIPAddressSku))
 {
     Name = name;
     IdleTimeoutInMinutes = idleTimeoutInMinutes;
     DnsSettings          = dnsSettings;
     IpTags                 = ipTags;
     PublicIPPrefix         = publicIPPrefix;
     PublicIPAddressVersion = publicIPAddressVersion;
     DeleteOption           = deleteOption;
     Sku = sku;
     CustomInit();
 }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the KeyVaultSecretReference class.
 /// </summary>
 /// <param name="secretUrl">The URL referencing a secret in a Key
 /// Vault.</param>
 /// <param name="sourceVault">The relative URL of the Key Vault
 /// containing the secret.</param>
 public KeyVaultSecretReference(string secretUrl, SubResource sourceVault)
 {
     SecretUrl   = secretUrl;
     SourceVault = sourceVault;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the CloudServiceNetworkProfile class.
 /// </summary>
 /// <param name="loadBalancerConfigurations">List of Load balancer
 /// configurations. Cloud service can have up to two load balancer
 /// configurations, corresponding to a Public Load Balancer and an
 /// Internal Load Balancer.</param>
 /// <param name="swappableCloudService">The id reference of the cloud
 /// service containing the target IP with which the subject cloud
 /// service can perform a swap. This property cannot be updated once it
 /// is set. The swappable cloud service referred by this id must be
 /// present otherwise an error will be thrown.</param>
 public CloudServiceNetworkProfile(IList <LoadBalancerConfiguration> loadBalancerConfigurations = default(IList <LoadBalancerConfiguration>), SubResource swappableCloudService = default(SubResource))
 {
     LoadBalancerConfigurations = loadBalancerConfigurations;
     SwappableCloudService      = swappableCloudService;
     CustomInit();
 }
Пример #14
0
 /// <summary>
 /// Initializes a new instance of the ImageOSDisk class.
 /// </summary>
 /// <param name="osType">This property allows you to specify the type
 /// of the OS that is included in the disk if creating a VM from a
 /// custom image. &lt;br&gt;&lt;br&gt; Possible values are:
 /// &lt;br&gt;&lt;br&gt; **Windows** &lt;br&gt;&lt;br&gt; **Linux**.
 /// Possible values include: 'Windows', 'Linux'</param>
 /// <param name="osState">The OS State. Possible values include:
 /// 'Generalized', 'Specialized'</param>
 /// <param name="snapshot">The snapshot.</param>
 /// <param name="managedDisk">The managedDisk.</param>
 /// <param name="blobUri">The Virtual Hard Disk.</param>
 /// <param name="caching">Specifies the caching requirements.
 /// &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 /// **None** &lt;br&gt;&lt;br&gt; **ReadOnly** &lt;br&gt;&lt;br&gt;
 /// **ReadWrite** &lt;br&gt;&lt;br&gt; Default: **None for Standard
 /// storage. ReadOnly for Premium storage**. Possible values include:
 /// 'None', 'ReadOnly', 'ReadWrite'</param>
 /// <param name="diskSizeGB">Specifies the size of empty data disks in
 /// gigabytes. This element can be used to overwrite the name of the
 /// disk in a virtual machine image. &lt;br&gt;&lt;br&gt; This value
 /// cannot be larger than 1023 GB</param>
 /// <param name="storageAccountType">Specifies the storage account type
 /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data
 /// disks, it cannot be used with OS Disk. Possible values include:
 /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS',
 /// 'UltraSSD_LRS'</param>
 /// <param name="diskEncryptionSet">Specifies the customer managed disk
 /// encryption set resource id for the managed image disk.</param>
 public ImageOSDisk(OperatingSystemTypes osType, OperatingSystemStateTypes osState, SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes?caching = default(CachingTypes?), int?diskSizeGB = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters))
     : base(snapshot, managedDisk, blobUri, caching, diskSizeGB, storageAccountType, diskEncryptionSet)
 {
     OsType  = osType;
     OsState = osState;
     CustomInit();
 }
Пример #15
0
 /// <summary>
 /// Initializes a new instance of the VirtualMachineScaleSetVM class.
 /// </summary>
 /// <param name="location">Resource location</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="instanceId">The virtual machine instance ID.</param>
 /// <param name="sku">The virtual machine SKU.</param>
 /// <param name="latestModelApplied">Specifies whether the latest model
 /// has been applied to the virtual machine.</param>
 /// <param name="vmId">Azure VM unique ID.</param>
 /// <param name="instanceView">The virtual machine instance
 /// view.</param>
 /// <param name="hardwareProfile">Specifies the hardware settings for
 /// the virtual machine.</param>
 /// <param name="storageProfile">Specifies the storage settings for the
 /// virtual machine disks.</param>
 /// <param name="additionalCapabilities">Specifies additional
 /// capabilities enabled or disabled on the virtual machine in the
 /// scale set. For instance: whether the virtual machine has the
 /// capability to support attaching managed data disks with
 /// UltraSSD_LRS storage account type.</param>
 /// <param name="osProfile">Specifies the operating system settings for
 /// the virtual machine.</param>
 /// <param name="securityProfile">Specifies the Security related
 /// profile settings for the virtual machine.</param>
 /// <param name="networkProfile">Specifies the network interfaces of
 /// the virtual machine.</param>
 /// <param name="networkProfileConfiguration">Specifies the network
 /// profile configuration of the virtual machine.</param>
 /// <param name="diagnosticsProfile">Specifies the boot diagnostic
 /// settings state. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2015-06-15.</param>
 /// <param name="availabilitySet">Specifies information about the
 /// availability set that the virtual machine should be assigned to.
 /// Virtual machines specified in the same availability set are
 /// allocated to different nodes to maximize availability. For more
 /// information about availability sets, see [Availability sets
 /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).
 /// &lt;br&gt;&lt;br&gt; For more information on Azure planned
 /// maintenance, see [Maintenance and updates for Virtual Machines in
 /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)
 /// &lt;br&gt;&lt;br&gt; Currently, a VM can only be added to
 /// availability set at creation time. An existing VM cannot be added
 /// to an availability set.</param>
 /// <param name="provisioningState">The provisioning state, which only
 /// appears in the response.</param>
 /// <param name="licenseType">Specifies that the image or disk that is
 /// being used was licensed on-premises. &lt;br&gt;&lt;br&gt; Possible
 /// values for Windows Server operating system are:
 /// &lt;br&gt;&lt;br&gt; Windows_Client &lt;br&gt;&lt;br&gt;
 /// Windows_Server &lt;br&gt;&lt;br&gt; Possible values for Linux
 /// Server operating system are: &lt;br&gt;&lt;br&gt; RHEL_BYOS (for
 /// RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS (for SUSE)
 /// &lt;br&gt;&lt;br&gt; For more information, see [Azure Hybrid Use
 /// Benefit for Windows
 /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
 /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for Linux
 /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
 /// &lt;br&gt;&lt;br&gt; Minimum api-version: 2015-06-15</param>
 /// <param name="modelDefinitionApplied">Specifies whether the model
 /// applied to the virtual machine is the model of the virtual machine
 /// scale set or the customized model for the virtual machine.</param>
 /// <param name="protectionPolicy">Specifies the protection policy of
 /// the virtual machine.</param>
 /// <param name="userData">UserData for the VM, which must be base-64
 /// encoded. Customer should not pass any secrets in here.
 /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2021-03-01</param>
 /// <param name="plan">Specifies information about the marketplace
 /// image used to create the virtual machine. This element is only used
 /// for marketplace images. Before you can use a marketplace image from
 /// an API, you must enable the image for programmatic use.  In the
 /// Azure portal, find the marketplace image that you want to use and
 /// then click **Want to deploy programmatically, Get Started -&gt;**.
 /// Enter any required information and then click **Save**.</param>
 /// <param name="resources">The virtual machine child extension
 /// resources.</param>
 /// <param name="zones">The virtual machine zones.</param>
 /// <param name="identity">The identity of the virtual machine, if
 /// configured.</param>
 public VirtualMachineScaleSetVM(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), string instanceId = default(string), Sku sku = default(Sku), bool?latestModelApplied = default(bool?), string vmId = default(string), VirtualMachineScaleSetVMInstanceView instanceView = default(VirtualMachineScaleSetVMInstanceView), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), SecurityProfile securityProfile = default(SecurityProfile), NetworkProfile networkProfile = default(NetworkProfile), VirtualMachineScaleSetVMNetworkProfileConfiguration networkProfileConfiguration = default(VirtualMachineScaleSetVMNetworkProfileConfiguration), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), string licenseType = default(string), string modelDefinitionApplied = default(string), VirtualMachineScaleSetVMProtectionPolicy protectionPolicy = default(VirtualMachineScaleSetVMProtectionPolicy), string userData = default(string), Plan plan = default(Plan), IList <VirtualMachineExtension> resources = default(IList <VirtualMachineExtension>), IList <string> zones = default(IList <string>), VirtualMachineIdentity identity = default(VirtualMachineIdentity))
     : base(location, id, name, type, tags)
 {
     InstanceId                  = instanceId;
     Sku                         = sku;
     LatestModelApplied          = latestModelApplied;
     VmId                        = vmId;
     InstanceView                = instanceView;
     HardwareProfile             = hardwareProfile;
     StorageProfile              = storageProfile;
     AdditionalCapabilities      = additionalCapabilities;
     OsProfile                   = osProfile;
     SecurityProfile             = securityProfile;
     NetworkProfile              = networkProfile;
     NetworkProfileConfiguration = networkProfileConfiguration;
     DiagnosticsProfile          = diagnosticsProfile;
     AvailabilitySet             = availabilitySet;
     ProvisioningState           = provisioningState;
     LicenseType                 = licenseType;
     ModelDefinitionApplied      = modelDefinitionApplied;
     ProtectionPolicy            = protectionPolicy;
     UserData                    = userData;
     Plan                        = plan;
     Resources                   = resources;
     Zones                       = zones;
     Identity                    = identity;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the VirtualMachineUpdate class.
 /// </summary>
 /// <param name="tags">Resource tags</param>
 /// <param name="plan">Specifies information about the marketplace
 /// image used to create the virtual machine. This element is only used
 /// for marketplace images. Before you can use a marketplace image from
 /// an API, you must enable the image for programmatic use.  In the
 /// Azure portal, find the marketplace image that you want to use and
 /// then click **Want to deploy programmatically, Get Started -&gt;**.
 /// Enter any required information and then click **Save**.</param>
 /// <param name="hardwareProfile">Specifies the hardware settings for
 /// the virtual machine.</param>
 /// <param name="storageProfile">Specifies the storage settings for the
 /// virtual machine disks.</param>
 /// <param name="additionalCapabilities">Specifies additional
 /// capabilities enabled or disabled on the virtual machine.</param>
 /// <param name="osProfile">Specifies the operating system settings
 /// used while creating the virtual machine. Some of the settings
 /// cannot be changed once VM is provisioned.</param>
 /// <param name="networkProfile">Specifies the network interfaces of
 /// the virtual machine.</param>
 /// <param name="securityProfile">Specifies the Security related
 /// profile settings for the virtual machine.</param>
 /// <param name="diagnosticsProfile">Specifies the boot diagnostic
 /// settings state. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2015-06-15.</param>
 /// <param name="availabilitySet">Specifies information about the
 /// availability set that the virtual machine should be assigned to.
 /// Virtual machines specified in the same availability set are
 /// allocated to different nodes to maximize availability. For more
 /// information about availability sets, see [Availability sets
 /// overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview).
 /// &lt;br&gt;&lt;br&gt; For more information on Azure planned
 /// maintenance, see [Maintenance and updates for Virtual Machines in
 /// Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates)
 /// &lt;br&gt;&lt;br&gt; Currently, a VM can only be added to
 /// availability set at creation time. The availability set to which
 /// the VM is being added should be under the same resource group as
 /// the availability set resource. An existing VM cannot be added to an
 /// availability set. &lt;br&gt;&lt;br&gt;This property cannot exist
 /// along with a non-null properties.virtualMachineScaleSet
 /// reference.</param>
 /// <param name="virtualMachineScaleSet">Specifies information about
 /// the virtual machine scale set that the virtual machine should be
 /// assigned to. Virtual machines specified in the same virtual machine
 /// scale set are allocated to different nodes to maximize
 /// availability. Currently, a VM can only be added to virtual machine
 /// scale set at creation time. An existing VM cannot be added to a
 /// virtual machine scale set. &lt;br&gt;&lt;br&gt;This property cannot
 /// exist along with a non-null properties.availabilitySet reference.
 /// &lt;br&gt;&lt;br&gt;Minimum api‐version: 2019‐03‐01</param>
 /// <param name="proximityPlacementGroup">Specifies information about
 /// the proximity placement group that the virtual machine should be
 /// assigned to. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2018-04-01.</param>
 /// <param name="priority">Specifies the priority for the virtual
 /// machine. &lt;br&gt;&lt;br&gt;Minimum api-version: 2019-03-01.
 /// Possible values include: 'Regular', 'Low', 'Spot'</param>
 /// <param name="evictionPolicy">Specifies the eviction policy for the
 /// Azure Spot virtual machine and Azure Spot scale set.
 /// &lt;br&gt;&lt;br&gt;For Azure Spot virtual machines, both
 /// 'Deallocate' and 'Delete' are supported and the minimum api-version
 /// is 2019-03-01. &lt;br&gt;&lt;br&gt;For Azure Spot scale sets, both
 /// 'Deallocate' and 'Delete' are supported and the minimum api-version
 /// is 2017-10-30-preview. Possible values include: 'Deallocate',
 /// 'Delete'</param>
 /// <param name="billingProfile">Specifies the billing related details
 /// of a Azure Spot virtual machine. &lt;br&gt;&lt;br&gt;Minimum
 /// api-version: 2019-03-01.</param>
 /// <param name="host">Specifies information about the dedicated host
 /// that the virtual machine resides in. &lt;br&gt;&lt;br&gt;Minimum
 /// api-version: 2018-10-01.</param>
 /// <param name="hostGroup">Specifies information about the dedicated
 /// host group that the virtual machine resides in.
 /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2020-06-01.
 /// &lt;br&gt;&lt;br&gt;NOTE: User cannot specify both host and
 /// hostGroup properties.</param>
 /// <param name="provisioningState">The provisioning state, which only
 /// appears in the response.</param>
 /// <param name="instanceView">The virtual machine instance
 /// view.</param>
 /// <param name="licenseType">Specifies that the image or disk that is
 /// being used was licensed on-premises. &lt;br&gt;&lt;br&gt; Possible
 /// values for Windows Server operating system are:
 /// &lt;br&gt;&lt;br&gt; Windows_Client &lt;br&gt;&lt;br&gt;
 /// Windows_Server &lt;br&gt;&lt;br&gt; Possible values for Linux
 /// Server operating system are: &lt;br&gt;&lt;br&gt; RHEL_BYOS (for
 /// RHEL) &lt;br&gt;&lt;br&gt; SLES_BYOS (for SUSE)
 /// &lt;br&gt;&lt;br&gt; For more information, see [Azure Hybrid Use
 /// Benefit for Windows
 /// Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing)
 /// &lt;br&gt;&lt;br&gt; [Azure Hybrid Use Benefit for Linux
 /// Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux)
 /// &lt;br&gt;&lt;br&gt; Minimum api-version: 2015-06-15</param>
 /// <param name="vmId">Specifies the VM unique ID which is a 128-bits
 /// identifier that is encoded and stored in all Azure IaaS VMs SMBIOS
 /// and can be read using platform BIOS commands.</param>
 /// <param name="extensionsTimeBudget">Specifies the time alloted for
 /// all extensions to start. The time duration should be between 15
 /// minutes and 120 minutes (inclusive) and should be specified in ISO
 /// 8601 format. The default value is 90 minutes (PT1H30M).
 /// &lt;br&gt;&lt;br&gt; Minimum api-version: 2020-06-01</param>
 /// <param name="platformFaultDomain">Specifies the scale set logical
 /// fault domain into which the Virtual Machine will be created. By
 /// default, the Virtual Machine will by automatically assigned to a
 /// fault domain that best maintains balance across available fault
 /// domains.&lt;br&gt;&lt;li&gt;This is applicable only if the
 /// 'virtualMachineScaleSet' property of this Virtual Machine is
 /// set.&lt;li&gt;The Virtual Machine Scale Set that is referenced,
 /// must have 'platformFaultDomainCount' &amp;gt; 1.&lt;li&gt;This
 /// property cannot be updated once the Virtual Machine is
 /// created.&lt;li&gt;Fault domain assignment can be viewed in the
 /// Virtual Machine Instance View.&lt;br&gt;&lt;br&gt;Minimum
 /// api‐version: 2020‐12‐01</param>
 public VirtualMachineUpdate(IDictionary <string, string> tags = default(IDictionary <string, string>), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), SecurityProfile securityProfile = default(SecurityProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), SubResource hostGroup = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), string extensionsTimeBudget = default(string), int?platformFaultDomain = default(int?))
     : base(tags)
 {
     Plan                    = plan;
     HardwareProfile         = hardwareProfile;
     StorageProfile          = storageProfile;
     AdditionalCapabilities  = additionalCapabilities;
     OsProfile               = osProfile;
     NetworkProfile          = networkProfile;
     SecurityProfile         = securityProfile;
     DiagnosticsProfile      = diagnosticsProfile;
     AvailabilitySet         = availabilitySet;
     VirtualMachineScaleSet  = virtualMachineScaleSet;
     ProximityPlacementGroup = proximityPlacementGroup;
     Priority                = priority;
     EvictionPolicy          = evictionPolicy;
     BillingProfile          = billingProfile;
     Host                    = host;
     HostGroup               = hostGroup;
     ProvisioningState       = provisioningState;
     InstanceView            = instanceView;
     LicenseType             = licenseType;
     VmId                    = vmId;
     ExtensionsTimeBudget    = extensionsTimeBudget;
     PlatformFaultDomain     = platformFaultDomain;
     CustomInit();
 }
Пример #17
0
 /// <summary>
 /// Initializes a new instance of the VirtualMachineUpdate class.
 /// </summary>
 /// <param name="tags">Resource tags</param>
 /// <param name="plan">Specifies information about the marketplace
 /// image used to create the virtual machine. This element is only used
 /// for marketplace images. Before you can use a marketplace image from
 /// an API, you must enable the image for programmatic use.  In the
 /// Azure portal, find the marketplace image that you want to use and
 /// then click **Want to deploy programmatically, Get Started -&gt;**.
 /// Enter any required information and then click **Save**.</param>
 /// <param name="hardwareProfile">Specifies the hardware settings for
 /// the virtual machine.</param>
 /// <param name="storageProfile">Specifies the storage settings for the
 /// virtual machine disks.</param>
 /// <param name="additionalCapabilities">Specifies additional
 /// capabilities enabled or disabled on the virtual machine.</param>
 /// <param name="osProfile">Specifies the operating system settings for
 /// the virtual machine.</param>
 /// <param name="networkProfile">Specifies the network interfaces of
 /// the virtual machine.</param>
 /// <param name="diagnosticsProfile">Specifies the boot diagnostic
 /// settings state. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2015-06-15.</param>
 /// <param name="availabilitySet">Specifies information about the
 /// availability set that the virtual machine should be assigned to.
 /// Virtual machines specified in the same availability set are
 /// allocated to different nodes to maximize availability. For more
 /// information about availability sets, see [Manage the availability
 /// of virtual
 /// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
 /// &lt;br&gt;&lt;br&gt; For more information on Azure planned
 /// maintenance, see [Planned maintenance for virtual machines in
 /// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
 /// &lt;br&gt;&lt;br&gt; Currently, a VM can only be added to
 /// availability set at creation time. An existing VM cannot be added
 /// to an availability set.</param>
 /// <param name="provisioningState">The provisioning state, which only
 /// appears in the response.</param>
 /// <param name="instanceView">The virtual machine instance
 /// view.</param>
 /// <param name="licenseType">Specifies that the image or disk that is
 /// being used was licensed on-premises. This element is only used for
 /// images that contain the Windows Server operating system.
 /// &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 /// Windows_Client &lt;br&gt;&lt;br&gt; Windows_Server
 /// &lt;br&gt;&lt;br&gt; If this element is included in a request for
 /// an update, the value must match the initial value. This value
 /// cannot be updated. &lt;br&gt;&lt;br&gt; For more information, see
 /// [Azure Hybrid Use Benefit for Windows
 /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
 /// &lt;br&gt;&lt;br&gt; Minimum api-version: 2015-06-15</param>
 /// <param name="vmId">Specifies the VM unique ID which is a 128-bits
 /// identifier that is encoded and stored in all Azure IaaS VMs SMBIOS
 /// and can be read using platform BIOS commands.</param>
 /// <param name="identity">The identity of the virtual machine, if
 /// configured.</param>
 /// <param name="zones">The virtual machine zones.</param>
 public VirtualMachineUpdate(IDictionary <string, string> tags = default(IDictionary <string, string>), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList <string> zones = default(IList <string>))
     : base(tags)
 {
     Plan                   = plan;
     HardwareProfile        = hardwareProfile;
     StorageProfile         = storageProfile;
     AdditionalCapabilities = additionalCapabilities;
     OsProfile              = osProfile;
     NetworkProfile         = networkProfile;
     DiagnosticsProfile     = diagnosticsProfile;
     AvailabilitySet        = availabilitySet;
     ProvisioningState      = provisioningState;
     InstanceView           = instanceView;
     LicenseType            = licenseType;
     VmId                   = vmId;
     Identity               = identity;
     Zones                  = zones;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the VirtualMachineScaleSet class.
 /// </summary>
 /// <param name="location">Resource location</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="sku">The virtual machine scale set sku.</param>
 /// <param name="plan">Specifies information about the marketplace
 /// image used to create the virtual machine. This element is only used
 /// for marketplace images. Before you can use a marketplace image from
 /// an API, you must enable the image for programmatic use.  In the
 /// Azure portal, find the marketplace image that you want to use and
 /// then click **Want to deploy programmatically, Get Started -&gt;**.
 /// Enter any required information and then click **Save**.</param>
 /// <param name="upgradePolicy">The upgrade policy.</param>
 /// <param name="automaticRepairsPolicy">Policy for automatic
 /// repairs.</param>
 /// <param name="virtualMachineProfile">The virtual machine
 /// profile.</param>
 /// <param name="provisioningState">The provisioning state, which only
 /// appears in the response.</param>
 /// <param name="overprovision">Specifies whether the Virtual Machine
 /// Scale Set should be overprovisioned.</param>
 /// <param name="doNotRunExtensionsOnOverprovisionedVMs">When
 /// Overprovision is enabled, extensions are launched only on the
 /// requested number of VMs which are finally kept. This property will
 /// hence ensure that the extensions do not run on the extra
 /// overprovisioned VMs.</param>
 /// <param name="uniqueId">Specifies the ID which uniquely identifies a
 /// Virtual Machine Scale Set.</param>
 /// <param name="singlePlacementGroup">When true this limits the scale
 /// set to a single placement group, of max size 100 virtual machines.
 /// NOTE: If singlePlacementGroup is true, it may be modified to false.
 /// However, if singlePlacementGroup is false, it may not be modified
 /// to true.</param>
 /// <param name="zoneBalance">Whether to force strictly even Virtual
 /// Machine distribution cross x-zones in case there is zone
 /// outage.</param>
 /// <param name="platformFaultDomainCount">Fault Domain count for each
 /// placement group.</param>
 /// <param name="proximityPlacementGroup">Specifies information about
 /// the proximity placement group that the virtual machine scale set
 /// should be assigned to. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2018-04-01.</param>
 /// <param name="hostGroup">Specifies information about the dedicated
 /// host group that the virtual machine scale set resides in.
 /// &lt;br&gt;&lt;br&gt;Minimum api-version: 2020-06-01.</param>
 /// <param name="additionalCapabilities">Specifies additional
 /// capabilities enabled or disabled on the Virtual Machines in the
 /// Virtual Machine Scale Set. For instance: whether the Virtual
 /// Machines have the capability to support attaching managed data
 /// disks with UltraSSD_LRS storage account type.</param>
 /// <param name="scaleInPolicy">Specifies the scale-in policy that
 /// decides which virtual machines are chosen for removal when a
 /// Virtual Machine Scale Set is scaled-in.</param>
 /// <param name="identity">The identity of the virtual machine scale
 /// set, if configured.</param>
 /// <param name="zones">The virtual machine scale set zones. NOTE:
 /// Availability zones can only be set when you create the scale
 /// set</param>
 /// <param name="extendedLocation">The extended location of the Virtual
 /// Machine Scale Set.</param>
 public VirtualMachineScaleSet(string location, string id, string name, string type, IDictionary <string, string> tags, Sku sku, Plan plan, UpgradePolicy upgradePolicy, AutomaticRepairsPolicy automaticRepairsPolicy, VirtualMachineScaleSetVMProfile virtualMachineProfile, string provisioningState, bool?overprovision, bool?doNotRunExtensionsOnOverprovisionedVMs, string uniqueId, bool?singlePlacementGroup, bool?zoneBalance, int?platformFaultDomainCount, SubResource proximityPlacementGroup, SubResource hostGroup, AdditionalCapabilities additionalCapabilities, ScaleInPolicy scaleInPolicy, VirtualMachineScaleSetIdentity identity, IList <string> zones, ExtendedLocation extendedLocation)
     : base(location, id, name, type, tags)
 {
     Sku                    = sku;
     Plan                   = plan;
     UpgradePolicy          = upgradePolicy;
     AutomaticRepairsPolicy = automaticRepairsPolicy;
     VirtualMachineProfile  = virtualMachineProfile;
     ProvisioningState      = provisioningState;
     Overprovision          = overprovision;
     DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs;
     UniqueId                 = uniqueId;
     SinglePlacementGroup     = singlePlacementGroup;
     ZoneBalance              = zoneBalance;
     PlatformFaultDomainCount = platformFaultDomainCount;
     ProximityPlacementGroup  = proximityPlacementGroup;
     HostGroup                = hostGroup;
     AdditionalCapabilities   = additionalCapabilities;
     ScaleInPolicy            = scaleInPolicy;
     Identity                 = identity;
     Zones            = zones;
     ExtendedLocation = extendedLocation;
     CustomInit();
 }
Пример #19
0
 /// <summary>
 /// Initializes a new instance of the
 /// VirtualMachineScaleSetNetworkConfiguration class.
 /// </summary>
 /// <param name="name">The network configuration name.</param>
 /// <param name="ipConfigurations">Specifies the IP configurations of
 /// the network interface.</param>
 /// <param name="id">Resource Id</param>
 /// <param name="primary">Specifies the primary network interface in
 /// case the virtual machine has more than 1 network interface.</param>
 /// <param name="enableAcceleratedNetworking">Specifies whether the
 /// network interface is accelerated networking-enabled.</param>
 /// <param name="enableFpga">Specifies whether the network interface is
 /// FPGA networking-enabled.</param>
 /// <param name="networkSecurityGroup">The network security
 /// group.</param>
 /// <param name="dnsSettings">The dns settings to be applied on the
 /// network interfaces.</param>
 /// <param name="enableIPForwarding">Whether IP forwarding enabled on
 /// this NIC.</param>
 /// <param name="deleteOption">Specify what happens to the network
 /// interface when the VM is deleted. Possible values include:
 /// 'Delete', 'Detach'</param>
 public VirtualMachineScaleSetNetworkConfiguration(string name, IList <VirtualMachineScaleSetIPConfiguration> ipConfigurations, string id = default(string), bool?primary = default(bool?), bool?enableAcceleratedNetworking = default(bool?), bool?enableFpga = default(bool?), SubResource networkSecurityGroup = default(SubResource), VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetNetworkConfigurationDnsSettings), bool?enableIPForwarding = default(bool?), string deleteOption = default(string))
     : base(id)
 {
     Name    = name;
     Primary = primary;
     EnableAcceleratedNetworking = enableAcceleratedNetworking;
     EnableFpga           = enableFpga;
     NetworkSecurityGroup = networkSecurityGroup;
     DnsSettings          = dnsSettings;
     IpConfigurations     = ipConfigurations;
     EnableIPForwarding   = enableIPForwarding;
     DeleteOption         = deleteOption;
     CustomInit();
 }
 public VirtualMachine(string location, string id, string name, string type, IDictionary <string, string> tags, Plan plan, HardwareProfile hardwareProfile, StorageProfile storageProfile, AdditionalCapabilities additionalCapabilities, OSProfile osProfile, NetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, SubResource availabilitySet, SubResource virtualMachineScaleSet, SubResource proximityPlacementGroup, string priority, string evictionPolicy, BillingProfile billingProfile, SubResource host, SubResource hostGroup, string provisioningState, VirtualMachineInstanceView instanceView, string licenseType, string vmId, string extensionsTimeBudget, IList <VirtualMachineExtension> resources, VirtualMachineIdentity identity)
     : base(location, id, name, type, tags)
 {
     Plan                    = plan;
     HardwareProfile         = hardwareProfile;
     StorageProfile          = storageProfile;
     AdditionalCapabilities  = additionalCapabilities;
     OsProfile               = osProfile;
     NetworkProfile          = networkProfile;
     SecurityProfile         = securityProfile;
     DiagnosticsProfile      = diagnosticsProfile;
     AvailabilitySet         = availabilitySet;
     VirtualMachineScaleSet  = virtualMachineScaleSet;
     ProximityPlacementGroup = proximityPlacementGroup;
     Priority                = priority;
     EvictionPolicy          = evictionPolicy;
     BillingProfile          = billingProfile;
     Host                    = host;
     HostGroup               = hostGroup;
     ProvisioningState       = provisioningState;
     InstanceView            = instanceView;
     LicenseType             = licenseType;
     VmId                    = vmId;
     ExtensionsTimeBudget    = extensionsTimeBudget;
     Resources               = resources;
     Identity                = identity;
     CustomInit();
 }
Пример #21
0
 /// <summary>
 /// Initializes a new instance of the ImageDataDisk class.
 /// </summary>
 /// <param name="lun">Specifies the logical unit number of the data
 /// disk. This value is used to identify data disks within the VM and
 /// therefore must be unique for each data disk attached to a
 /// VM.</param>
 /// <param name="snapshot">The snapshot.</param>
 /// <param name="managedDisk">The managedDisk.</param>
 /// <param name="blobUri">The Virtual Hard Disk.</param>
 /// <param name="caching">Specifies the caching requirements.
 /// &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 /// **None** &lt;br&gt;&lt;br&gt; **ReadOnly** &lt;br&gt;&lt;br&gt;
 /// **ReadWrite** &lt;br&gt;&lt;br&gt; Default: **None for Standard
 /// storage. ReadOnly for Premium storage**. Possible values include:
 /// 'None', 'ReadOnly', 'ReadWrite'</param>
 /// <param name="diskSizeGB">Specifies the size of empty data disks in
 /// gigabytes. This element can be used to overwrite the name of the
 /// disk in a virtual machine image. &lt;br&gt;&lt;br&gt; This value
 /// cannot be larger than 1023 GB</param>
 /// <param name="storageAccountType">Specifies the storage account type
 /// for the managed disk. NOTE: UltraSSD_LRS can only be used with data
 /// disks, it cannot be used with OS Disk. Possible values include:
 /// 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS',
 /// 'UltraSSD_LRS'</param>
 /// <param name="diskEncryptionSet">Specifies the customer managed disk
 /// encryption set resource id for the managed image disk.</param>
 public ImageDataDisk(int lun, SubResource snapshot = default(SubResource), SubResource managedDisk = default(SubResource), string blobUri = default(string), CachingTypes?caching = default(CachingTypes?), int?diskSizeGB = default(int?), string storageAccountType = default(string), DiskEncryptionSetParameters diskEncryptionSet = default(DiskEncryptionSetParameters))
     : base(snapshot, managedDisk, blobUri, caching, diskSizeGB, storageAccountType, diskEncryptionSet)
 {
     Lun = lun;
     CustomInit();
 }
        private void TestVMScaleSetAppGwWithASTests(
            MockContext context,
            string priority,
            string evictionPolicy = null,
            string vmssSkuTier    = "Standard",
            string vmssASMin      = "1",
            string vmssASMax      = "100",
            string vmssSize       = VirtualMachineSizeTypes.StandardA1,
            bool hasManagedDisks  = false,
            bool hasSPG           = true,
            int vmssSkuCapacity   = 2,
            int AppGWMin          = 2,
            int AppGWMax          = 10
            )
        {
            string originalTestLocation = Environment.GetEnvironmentVariable("AZURE_VM_TEST_LOCATION");

            // Create resource group
            var    rgName             = TestUtilities.GenerateName(TestPrefix);
            var    vmssName           = TestUtilities.GenerateName("vmss");
            string storageAccountName = TestUtilities.GenerateName(TestPrefix);
            VirtualMachineScaleSet inputVMScaleSet;

            bool passed = false;

            try
            {
                Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", "centralus");
                EnsureClientsInitialized(context);
                ImageReference imageRef = GetPlatformVMImage(useWindowsImage: true);

                var storageAccountOutput = CreateStorageAccount(rgName, storageAccountName);

                m_CrpClient.VirtualMachineScaleSets.Delete(rgName, "VMScaleSetDoesNotExist");

                // AppGW Configuration
                var vnetResponse         = CreateVNETWithSubnets(rgName, 2);
                var gatewaySubnet        = vnetResponse.Subnets[0];
                var vmssSubnet           = vnetResponse.Subnets[1];
                ApplicationGateway appgw = CreateApplicationGateway(rgName, gatewaySubnet);
                appgw.AutoscaleConfiguration = new ApplicationGatewayAutoscaleConfiguration(AppGWMin, AppGWMax);
                Microsoft.Azure.Management.Compute.Models.SubResource backendAddressPool = new Microsoft.Azure.Management.Compute.Models.SubResource()
                {
                    Id = appgw.BackendAddressPools[0].Id
                };

                var getResponse = CreateVMScaleSet_NoAsyncTracking(
                    rgName,
                    vmssName,
                    storageAccountOutput,
                    imageRef,
                    out inputVMScaleSet,
                    null,
                    (vmScaleSet) =>
                {
                    vmScaleSet.Overprovision = true;
                    vmScaleSet.VirtualMachineProfile.Priority       = priority;
                    vmScaleSet.VirtualMachineProfile.EvictionPolicy = evictionPolicy;
                    vmScaleSet.VirtualMachineProfile.NetworkProfile
                    .NetworkInterfaceConfigurations[0].IpConfigurations[0]
                    .ApplicationGatewayBackendAddressPools.Add(backendAddressPool);
                    vmScaleSet.Sku.Name     = vmssSize;
                    vmScaleSet.Sku.Tier     = vmssSkuTier;
                    vmScaleSet.Sku.Capacity = vmssSkuCapacity;
                },
                    machineSizeType: vmssSize,
                    createWithManagedDisks: hasManagedDisks,
                    singlePlacementGroup: hasSPG,
                    subnet: vmssSubnet);

                AutoscaleSettingResource resource = CreateAutoscale(rgName, vmssName, "VMSS", vmssASMin, vmssASMax);

                var getGwResponse = m_NrpClient.ApplicationGateways.Get(rgName, appgw.Name);
                Assert.True(2 == getGwResponse.BackendAddressPools[0].BackendIPConfigurations.Count);

                ValidateVMScaleSet(inputVMScaleSet, getResponse, hasManagedDisks);

                var getInstanceViewResponse = m_CrpClient.VirtualMachineScaleSets.GetInstanceView(rgName, vmssName);
                Assert.NotNull(getInstanceViewResponse);
                ValidateVMScaleSetInstanceView(inputVMScaleSet, getInstanceViewResponse);

                var listResponse = m_CrpClient.VirtualMachineScaleSets.List(rgName);
                ValidateVMScaleSet(
                    inputVMScaleSet,
                    listResponse.FirstOrDefault(x => x.Name == vmssName),
                    hasManagedDisks);

                var listSkusResponse = m_CrpClient.VirtualMachineScaleSets.ListSkus(rgName, vmssName);
                Assert.NotNull(listSkusResponse);
                Assert.NotNull(resource);
                Assert.False(listSkusResponse.Count() == 0);
                Assert.Same(inputVMScaleSet.VirtualMachineProfile.Priority.ToString(), priority);

                m_CrpClient.VirtualMachineScaleSets.Delete(rgName, vmssName);
                passed = true;
            }
            finally
            {
                Environment.SetEnvironmentVariable("AZURE_VM_TEST_LOCATION", originalTestLocation);
                //Cleanup the created resources. But don't wait since it takes too long, and it's not the purpose
                //of the test to cover deletion. CSM does persistent retrying over all RG resources.
                m_ResourcesClient.ResourceGroups.Delete(rgName);
            }
            Assert.True(passed);
        }
        protected override void ProcessRecord()
        {
            var vIpConfigurations = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIPConfiguration();

            // Subnet
            vIpConfigurations.Subnet = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();

            // ApplicationGatewayBackendAddressPools
            vIpConfigurations.ApplicationGatewayBackendAddressPools = new List<Microsoft.Azure.Management.Compute.Models.SubResource>();

            // LoadBalancerBackendAddressPools
            vIpConfigurations.LoadBalancerBackendAddressPools = new List<Microsoft.Azure.Management.Compute.Models.SubResource>();

            // LoadBalancerInboundNatPools
            vIpConfigurations.LoadBalancerInboundNatPools = new List<Microsoft.Azure.Management.Compute.Models.SubResource>();

            vIpConfigurations.Name = this.Name;
            vIpConfigurations.Id = this.Id;
            vIpConfigurations.Subnet.Id = this.SubnetId;
            if (this.ApplicationGatewayBackendAddressPoolsId != null)
            {
                foreach (var element in this.ApplicationGatewayBackendAddressPoolsId)
                {
                    var vApplicationGatewayBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vApplicationGatewayBackendAddressPools.Id = element;
                    vIpConfigurations.ApplicationGatewayBackendAddressPools.Add(vApplicationGatewayBackendAddressPools);
                }
            }

            if (this.LoadBalancerBackendAddressPoolsId != null)
            {
                foreach (var element in this.LoadBalancerBackendAddressPoolsId)
                {
                    var vLoadBalancerBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerBackendAddressPools.Id = element;
                    vIpConfigurations.LoadBalancerBackendAddressPools.Add(vLoadBalancerBackendAddressPools);
                }
            }

            if (this.LoadBalancerInboundNatPoolsId != null)
            {
                foreach (var element in this.LoadBalancerInboundNatPoolsId)
                {
                    var vLoadBalancerInboundNatPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerInboundNatPools.Id = element;
                    vIpConfigurations.LoadBalancerInboundNatPools.Add(vLoadBalancerInboundNatPools);
                }
            }

            WriteObject(vIpConfigurations);
        }
 /// <summary>
 /// Initializes a new instance of the VirtualMachine class.
 /// </summary>
 /// <param name="location">Resource location</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="plan">Specifies information about the marketplace
 /// image used to create the virtual machine. This element is only used
 /// for marketplace images. Before you can use a marketplace image from
 /// an API, you must enable the image for programmatic use.  In the
 /// Azure portal, find the marketplace image that you want to use and
 /// then click **Want to deploy programmatically, Get Started -&gt;**.
 /// Enter any required information and then click **Save**.</param>
 /// <param name="hardwareProfile">Specifies the hardware settings for
 /// the virtual machine.</param>
 /// <param name="storageProfile">Specifies the storage settings for the
 /// virtual machine disks.</param>
 /// <param name="additionalCapabilities">Specifies additional
 /// capabilities enabled or disabled on the virtual machine.</param>
 /// <param name="osProfile">Specifies the operating system settings
 /// used while creating the virtual machine. Some of the settings
 /// cannot be changed once VM is provisioned.</param>
 /// <param name="networkProfile">Specifies the network interfaces of
 /// the virtual machine.</param>
 /// <param name="diagnosticsProfile">Specifies the boot diagnostic
 /// settings state. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2015-06-15.</param>
 /// <param name="availabilitySet">Specifies information about the
 /// availability set that the virtual machine should be assigned to.
 /// Virtual machines specified in the same availability set are
 /// allocated to different nodes to maximize availability. For more
 /// information about availability sets, see [Manage the availability
 /// of virtual
 /// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
 /// &lt;br&gt;&lt;br&gt; For more information on Azure planned
 /// maintenance, see [Planned maintenance for virtual machines in
 /// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
 /// &lt;br&gt;&lt;br&gt; Currently, a VM can only be added to
 /// availability set at creation time. The availability set to which
 /// the VM is being added should be under the same resource group as
 /// the availability set resource. An existing VM cannot be added to an
 /// availability set. &lt;br&gt;&lt;br&gt;This property cannot exist
 /// along with a non-null properties.virtualMachineScaleSet
 /// reference.</param>
 /// <param name="virtualMachineScaleSet">Specifies information about
 /// the virtual machine scale set that the virtual machine should be
 /// assigned to. Virtual machines specified in the same virtual machine
 /// scale set are allocated to different nodes to maximize
 /// availability. Currently, a VM can only be added to virtual machine
 /// scale set at creation time. An existing VM cannot be added to a
 /// virtual machine scale set. &lt;br&gt;&lt;br&gt;This property cannot
 /// exist along with a non-null properties.availabilitySet reference.
 /// &lt;br&gt;&lt;br&gt;Minimum api‐version: 2019‐03‐01</param>
 /// <param name="proximityPlacementGroup">Specifies information about
 /// the proximity placement group that the virtual machine should be
 /// assigned to. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2018-04-01.</param>
 /// <param name="priority">Specifies the priority for the virtual
 /// machine. &lt;br&gt;&lt;br&gt;Minimum api-version: 2019-03-01.
 /// Possible values include: 'Regular', 'Low', 'Spot'</param>
 /// <param name="evictionPolicy">Specifies the eviction policy for the
 /// Azure Spot virtual machine and Azure Spot scale set.
 /// &lt;br&gt;&lt;br&gt;For Azure Spot virtual machines, the only
 /// supported value is 'Deallocate' and the minimum api-version is
 /// 2019-03-01. &lt;br&gt;&lt;br&gt;For Azure Spot scale sets, both
 /// 'Deallocate' and 'Delete' are supported and the minimum api-version
 /// is 2017-10-30-preview. Possible values include: 'Deallocate',
 /// 'Delete'</param>
 /// <param name="billingProfile">Specifies the billing related details
 /// of a Azure Spot virtual machine. &lt;br&gt;&lt;br&gt;Minimum
 /// api-version: 2019-03-01.</param>
 /// <param name="host">Specifies information about the dedicated host
 /// that the virtual machine resides in. &lt;br&gt;&lt;br&gt;Minimum
 /// api-version: 2018-10-01.</param>
 /// <param name="provisioningState">The provisioning state, which only
 /// appears in the response.</param>
 /// <param name="instanceView">The virtual machine instance
 /// view.</param>
 /// <param name="licenseType">Specifies that the image or disk that is
 /// being used was licensed on-premises. This element is only used for
 /// images that contain the Windows Server operating system.
 /// &lt;br&gt;&lt;br&gt; Possible values are: &lt;br&gt;&lt;br&gt;
 /// Windows_Client &lt;br&gt;&lt;br&gt; Windows_Server
 /// &lt;br&gt;&lt;br&gt; If this element is included in a request for
 /// an update, the value must match the initial value. This value
 /// cannot be updated. &lt;br&gt;&lt;br&gt; For more information, see
 /// [Azure Hybrid Use Benefit for Windows
 /// Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)
 /// &lt;br&gt;&lt;br&gt; Minimum api-version: 2015-06-15</param>
 /// <param name="vmId">Specifies the VM unique ID which is a 128-bits
 /// identifier that is encoded and stored in all Azure IaaS VMs SMBIOS
 /// and can be read using platform BIOS commands.</param>
 /// <param name="resources">The virtual machine child extension
 /// resources.</param>
 /// <param name="identity">The identity of the virtual machine, if
 /// configured.</param>
 /// <param name="zones">The virtual machine zones.</param>
 public VirtualMachine(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), Plan plan = default(Plan), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), SubResource virtualMachineScaleSet = default(SubResource), SubResource proximityPlacementGroup = default(SubResource), string priority = default(string), string evictionPolicy = default(string), BillingProfile billingProfile = default(BillingProfile), SubResource host = default(SubResource), string provisioningState = default(string), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), string licenseType = default(string), string vmId = default(string), IList <VirtualMachineExtension> resources = default(IList <VirtualMachineExtension>), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList <string> zones = default(IList <string>))
     : base(location, id, name, type, tags)
 {
     Plan                    = plan;
     HardwareProfile         = hardwareProfile;
     StorageProfile          = storageProfile;
     AdditionalCapabilities  = additionalCapabilities;
     OsProfile               = osProfile;
     NetworkProfile          = networkProfile;
     DiagnosticsProfile      = diagnosticsProfile;
     AvailabilitySet         = availabilitySet;
     VirtualMachineScaleSet  = virtualMachineScaleSet;
     ProximityPlacementGroup = proximityPlacementGroup;
     Priority                = priority;
     EvictionPolicy          = evictionPolicy;
     BillingProfile          = billingProfile;
     Host                    = host;
     ProvisioningState       = provisioningState;
     InstanceView            = instanceView;
     LicenseType             = licenseType;
     VmId                    = vmId;
     Resources               = resources;
     Identity                = identity;
     Zones                   = zones;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the
 /// VirtualMachineScaleSetPublicIPAddressConfiguration class.
 /// </summary>
 /// <param name="name">The publicIP address configuration name.</param>
 /// <param name="idleTimeoutInMinutes">The idle timeout of the public
 /// IP address.</param>
 /// <param name="dnsSettings">The dns settings to be applied on the
 /// publicIP addresses .</param>
 /// <param name="ipTags">The list of IP tags associated with the public
 /// IP address.</param>
 /// <param name="publicIPPrefix">The PublicIPPrefix from which to
 /// allocate publicIP addresses.</param>
 public VirtualMachineScaleSetPublicIPAddressConfiguration(string name, int?idleTimeoutInMinutes = default(int?), VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings dnsSettings = default(VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings), IList <VirtualMachineScaleSetIpTag> ipTags = default(IList <VirtualMachineScaleSetIpTag>), SubResource publicIPPrefix = default(SubResource))
 {
     Name = name;
     IdleTimeoutInMinutes = idleTimeoutInMinutes;
     DnsSettings          = dnsSettings;
     IpTags         = ipTags;
     PublicIPPrefix = publicIPPrefix;
     CustomInit();
 }
        private void Run()
        {
            var vIpConfigurations = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIPConfiguration();

            vIpConfigurations.Name    = this.MyInvocation.BoundParameters.ContainsKey("Name") ? this.Name : null;
            vIpConfigurations.Primary = this.Primary.IsPresent;
            vIpConfigurations.PrivateIPAddressVersion = this.MyInvocation.BoundParameters.ContainsKey("PrivateIPAddressVersion") ? this.PrivateIPAddressVersion : null;
            vIpConfigurations.Id = this.MyInvocation.BoundParameters.ContainsKey("Id") ? this.Id : null;

            // SubnetId
            if (this.MyInvocation.BoundParameters.ContainsKey("SubnetId"))
            {
                if (vIpConfigurations.Subnet == null)
                {
                    vIpConfigurations.Subnet = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();
                }

                vIpConfigurations.Subnet.Id = this.SubnetId;
            }

            // PublicIPAddressConfigurationName
            if (this.MyInvocation.BoundParameters.ContainsKey("PublicIPAddressConfigurationName"))
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }

                vIpConfigurations.PublicIPAddressConfiguration.Name = this.PublicIPAddressConfigurationName;
            }

            // PublicIPAddressConfigurationIdleTimeoutInMinutes
            if (this.MyInvocation.BoundParameters.ContainsKey("PublicIPAddressConfigurationIdleTimeoutInMinutes"))
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }

                vIpConfigurations.PublicIPAddressConfiguration.IdleTimeoutInMinutes = this.PublicIPAddressConfigurationIdleTimeoutInMinutes;
            }

            // DnsSetting
            if (this.MyInvocation.BoundParameters.ContainsKey("DnsSetting"))
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }
                if (vIpConfigurations.PublicIPAddressConfiguration.DnsSettings == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.DnsSettings = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings();
                }

                vIpConfigurations.PublicIPAddressConfiguration.DnsSettings.DomainNameLabel = this.DnsSetting;
            }

            // IpTag
            if (this.IpTag != null)
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }
                if (vIpConfigurations.PublicIPAddressConfiguration.IpTags == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.IpTags = new List <Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIpTag>();
                }
                foreach (var element in this.IpTag)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.IpTags.Add(element);
                }
            }

            // PublicIPPrefix
            if (this.MyInvocation.BoundParameters.ContainsKey("PublicIPPrefix"))
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }
                if (vIpConfigurations.PublicIPAddressConfiguration.PublicIPPrefix == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.PublicIPPrefix = new Microsoft.Azure.Management.Compute.Models.SubResource();
                }

                vIpConfigurations.PublicIPAddressConfiguration.PublicIPPrefix.Id = this.PublicIPPrefix;
            }

            // ApplicationGatewayBackendAddressPoolsId
            if (this.ApplicationGatewayBackendAddressPoolsId != null)
            {
                if (vIpConfigurations.ApplicationGatewayBackendAddressPools == null)
                {
                    vIpConfigurations.ApplicationGatewayBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.ApplicationGatewayBackendAddressPoolsId)
                {
                    var vApplicationGatewayBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vApplicationGatewayBackendAddressPools.Id = element;
                    vIpConfigurations.ApplicationGatewayBackendAddressPools.Add(vApplicationGatewayBackendAddressPools);
                }
            }

            // LoadBalancerBackendAddressPoolsId
            if (this.LoadBalancerBackendAddressPoolsId != null)
            {
                if (vIpConfigurations.LoadBalancerBackendAddressPools == null)
                {
                    vIpConfigurations.LoadBalancerBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.LoadBalancerBackendAddressPoolsId)
                {
                    var vLoadBalancerBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerBackendAddressPools.Id = element;
                    vIpConfigurations.LoadBalancerBackendAddressPools.Add(vLoadBalancerBackendAddressPools);
                }
            }

            // LoadBalancerInboundNatPoolsId
            if (this.LoadBalancerInboundNatPoolsId != null)
            {
                if (vIpConfigurations.LoadBalancerInboundNatPools == null)
                {
                    vIpConfigurations.LoadBalancerInboundNatPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.LoadBalancerInboundNatPoolsId)
                {
                    var vLoadBalancerInboundNatPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerInboundNatPools.Id = element;
                    vIpConfigurations.LoadBalancerInboundNatPools.Add(vLoadBalancerInboundNatPools);
                }
            }

            WriteObject(vIpConfigurations);
        }
Пример #27
0
 /// <summary>
 /// Initializes a new instance of the AvailabilitySet class.
 /// </summary>
 /// <param name="location">Resource location</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="platformUpdateDomainCount">Update Domain
 /// count.</param>
 /// <param name="platformFaultDomainCount">Fault Domain count.</param>
 /// <param name="virtualMachines">A list of references to all virtual
 /// machines in the availability set.</param>
 /// <param name="proximityPlacementGroup">Specifies information about
 /// the proximity placement group that the availability set should be
 /// assigned to. &lt;br&gt;&lt;br&gt;Minimum api-version:
 /// 2018-04-01.</param>
 /// <param name="statuses">The resource status information.</param>
 /// <param name="sku">Sku of the availability set, only name is
 /// required to be set. See AvailabilitySetSkuTypes for possible set of
 /// values. Use 'Aligned' for virtual machines with managed disks and
 /// 'Classic' for virtual machines with unmanaged disks. Default value
 /// is 'Classic'.</param>
 public AvailabilitySet(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), int?platformUpdateDomainCount = default(int?), int?platformFaultDomainCount = default(int?), IList <SubResource> virtualMachines = default(IList <SubResource>), SubResource proximityPlacementGroup = default(SubResource), IList <InstanceViewStatus> statuses = default(IList <InstanceViewStatus>), Sku sku = default(Sku))
     : base(location, id, name, type, tags)
 {
     PlatformUpdateDomainCount = platformUpdateDomainCount;
     PlatformFaultDomainCount  = platformFaultDomainCount;
     VirtualMachines           = virtualMachines;
     ProximityPlacementGroup   = proximityPlacementGroup;
     Statuses = statuses;
     Sku      = sku;
     CustomInit();
 }
        private void Run()
        {
            var vIpConfigurations = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIPConfiguration();

            vIpConfigurations.Name    = this.Name;
            vIpConfigurations.Primary = this.Primary;
            vIpConfigurations.PrivateIPAddressVersion = this.PrivateIPAddressVersion;
            vIpConfigurations.Id = this.Id;

            // SubnetId
            if (this.SubnetId != null)
            {
                if (vIpConfigurations.Subnet == null)
                {
                    vIpConfigurations.Subnet = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();
                }

                vIpConfigurations.Subnet.Id = this.SubnetId;
            }

            // PublicIPAddressConfigurationName
            if (this.PublicIPAddressConfigurationName != null)
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }

                vIpConfigurations.PublicIPAddressConfiguration.Name = this.PublicIPAddressConfigurationName;
            }

            // PublicIPAddressConfigurationIdleTimeoutInMinutes
            if (this.PublicIPAddressConfigurationIdleTimeoutInMinutes != null)
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }

                vIpConfigurations.PublicIPAddressConfiguration.IdleTimeoutInMinutes = this.PublicIPAddressConfigurationIdleTimeoutInMinutes;
            }

            // DnsSetting
            if (this.DnsSetting != null)
            {
                if (vIpConfigurations.PublicIPAddressConfiguration == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfiguration();
                }
                if (vIpConfigurations.PublicIPAddressConfiguration.DnsSettings == null)
                {
                    vIpConfigurations.PublicIPAddressConfiguration.DnsSettings = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettings();
                }

                vIpConfigurations.PublicIPAddressConfiguration.DnsSettings.DomainNameLabel = this.DnsSetting;
            }

            // ApplicationGatewayBackendAddressPoolsId
            if (this.ApplicationGatewayBackendAddressPoolsId != null)
            {
                if (vIpConfigurations.ApplicationGatewayBackendAddressPools == null)
                {
                    vIpConfigurations.ApplicationGatewayBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.ApplicationGatewayBackendAddressPoolsId)
                {
                    var vApplicationGatewayBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vApplicationGatewayBackendAddressPools.Id = element;
                    vIpConfigurations.ApplicationGatewayBackendAddressPools.Add(vApplicationGatewayBackendAddressPools);
                }
            }

            // LoadBalancerBackendAddressPoolsId
            if (this.LoadBalancerBackendAddressPoolsId != null)
            {
                if (vIpConfigurations.LoadBalancerBackendAddressPools == null)
                {
                    vIpConfigurations.LoadBalancerBackendAddressPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.LoadBalancerBackendAddressPoolsId)
                {
                    var vLoadBalancerBackendAddressPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerBackendAddressPools.Id = element;
                    vIpConfigurations.LoadBalancerBackendAddressPools.Add(vLoadBalancerBackendAddressPools);
                }
            }

            // LoadBalancerInboundNatPoolsId
            if (this.LoadBalancerInboundNatPoolsId != null)
            {
                if (vIpConfigurations.LoadBalancerInboundNatPools == null)
                {
                    vIpConfigurations.LoadBalancerInboundNatPools = new List <Microsoft.Azure.Management.Compute.Models.SubResource>();
                }
                foreach (var element in this.LoadBalancerInboundNatPoolsId)
                {
                    var vLoadBalancerInboundNatPools = new Microsoft.Azure.Management.Compute.Models.SubResource();
                    vLoadBalancerInboundNatPools.Id = element;
                    vIpConfigurations.LoadBalancerInboundNatPools.Add(vLoadBalancerInboundNatPools);
                }
            }

            WriteObject(vIpConfigurations);
        }
Пример #29
0
 /// <summary>
 /// Initializes a new instance of the Image class.
 /// </summary>
 /// <param name="location">Resource location</param>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="tags">Resource tags</param>
 /// <param name="sourceVirtualMachine">The source virtual machine from
 /// which Image is created.</param>
 /// <param name="storageProfile">Specifies the storage settings for the
 /// virtual machine disks.</param>
 /// <param name="provisioningState">The provisioning state.</param>
 /// <param name="hyperVGeneration">Specifies the HyperVGenerationType
 /// of the VirtualMachine created from the image. From API Version
 /// 2019-03-01 if the image source is a blob, then we need the user to
 /// specify the value, if the source is managed resource like disk or
 /// snapshot, we may require the user to specify the property if we
 /// cannot deduce it from the source managed resource. Possible values
 /// include: 'V1', 'V2'</param>
 /// <param name="extendedLocation">The extended location of the
 /// Image.</param>
 public Image(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string), ExtendedLocation extendedLocation = default(ExtendedLocation))
     : base(location, id, name, type, tags)
 {
     SourceVirtualMachine = sourceVirtualMachine;
     StorageProfile       = storageProfile;
     ProvisioningState    = provisioningState;
     HyperVGeneration     = hyperVGeneration;
     ExtendedLocation     = extendedLocation;
     CustomInit();
 }
Пример #30
0
 /// <summary>
 /// Initializes a new instance of the ImageUpdate class.
 /// </summary>
 /// <param name="tags">Resource tags</param>
 /// <param name="sourceVirtualMachine">The source virtual machine from
 /// which Image is created.</param>
 /// <param name="storageProfile">Specifies the storage settings for the
 /// virtual machine disks.</param>
 /// <param name="provisioningState">The provisioning state.</param>
 /// <param name="hyperVGeneration">Gets the HyperVGenerationType of the
 /// VirtualMachine created from the image. Possible values include:
 /// 'V1', 'V2'</param>
 public ImageUpdate(IDictionary <string, string> tags = default(IDictionary <string, string>), SubResource sourceVirtualMachine = default(SubResource), ImageStorageProfile storageProfile = default(ImageStorageProfile), string provisioningState = default(string), string hyperVGeneration = default(string))
     : base(tags)
 {
     SourceVirtualMachine = sourceVirtualMachine;
     StorageProfile       = storageProfile;
     ProvisioningState    = provisioningState;
     HyperVGeneration     = hyperVGeneration;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the CapacityReservationProfile class.
 /// </summary>
 /// <param name="capacityReservationGroup">Specifies the capacity
 /// reservation group resource id that should be used for allocating
 /// the virtual machine or scaleset vm instances provided enough
 /// capacity has been reserved. Please refer to
 /// https://aka.ms/CapacityReservation for more details.</param>
 public CapacityReservationProfile(SubResource capacityReservationGroup = default(SubResource))
 {
     CapacityReservationGroup = capacityReservationGroup;
     CustomInit();
 }