Exemplo n.º 1
0
        public void TestVMScenarioWithPlan()
        {
            using (var context = UndoContext.Current)
            {
                context.Start();
                EnsureClientsInitialized();

                string         imgRefId           = GetPlatformOSImage(useWindowsImage: true);
                var            rgName             = TestUtilities.GenerateName(TestPrefix);
                string         storageAccountName = TestUtilities.GenerateName(TestPrefix);
                string         asName             = TestUtilities.GenerateName("as");
                VirtualMachine inputVM;
                try
                {
                    var storageAccountOutput = CreateStorageAccount(rgName, storageAccountName);

                    var imageRef = new ImageReference
                    {
                        Publisher = "datastax",
                        Offer     = "datastax-enterprise-non-production-use-only",
                        Sku       = "sandbox_single-node",
                        Version   = "latest",
                    };

                    var plan = new Microsoft.Azure.Management.Compute.Models.Plan
                    {
                        Publisher = imageRef.Publisher,
                        Product   = imageRef.Offer,
                        Name      = imageRef.Sku,
                    };
                    var vm1 = CreateVM(rgName, asName, storageAccountOutput, imgRefId, out inputVM, (vm) =>
                    {
                        vm.StorageProfile.SourceImage    = null;
                        vm.StorageProfile.ImageReference = imageRef;
                        vm.Plan = plan;
                    }
                                       );

                    var getVMResponse = m_CrpClient.VirtualMachines.Get(rgName, inputVM.Name);
                    Assert.True(getVMResponse.StatusCode == HttpStatusCode.OK);
                    ValidateVM(inputVM, getVMResponse.VirtualMachine, Helpers.GetVMReferenceId(m_subId, rgName, inputVM.Name));

                    var listResponse = m_CrpClient.VirtualMachines.List(rgName);
                    Assert.True(listResponse.StatusCode == HttpStatusCode.OK);
                    ValidateVM(inputVM, listResponse.VirtualMachines.FirstOrDefault(x => x.Name == inputVM.Name),
                               Helpers.GetVMReferenceId(m_subId, rgName, inputVM.Name));
                }
                finally
                {
                    var deleteResourceGroupResponse = m_ResourcesClient.ResourceGroups.Delete(rgName);
                    Assert.True(deleteResourceGroupResponse.StatusCode == HttpStatusCode.OK);
                }
            }
        }
Exemplo n.º 2
0
        protected void ValidatePlan(Microsoft.Azure.Management.Compute.Models.Plan inputPlan, Microsoft.Azure.Management.Compute.Models.Plan outPutPlan)
        {
            if (inputPlan == null ||
                outPutPlan == null
                )
            {
                Assert.Equal(inputPlan, outPutPlan);
                return;
            }

            Assert.Equal(inputPlan.Name, outPutPlan.Name);
            Assert.Equal(inputPlan.Publisher, outPutPlan.Publisher);
            Assert.Equal(inputPlan.Product, outPutPlan.Product);
            Assert.Equal(inputPlan.PromotionCode, outPutPlan.PromotionCode);
        }
Exemplo n.º 3
0
        private void Run()
        {
            // Sku
            Microsoft.Azure.Management.Compute.Models.Sku vSku = null;

            // Plan
            Microsoft.Azure.Management.Compute.Models.Plan vPlan = null;

            // UpgradePolicy
            Microsoft.Azure.Management.Compute.Models.UpgradePolicy vUpgradePolicy = null;

            // VirtualMachineProfile
            Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile vVirtualMachineProfile = null;

            // Identity
            Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIdentity vIdentity = null;

            if (this.SkuName != null)
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Name = this.SkuName;
            }

            if (this.SkuTier != null)
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Tier = this.SkuTier;
            }

            if (this.SkuCapacity != null)
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Capacity = this.SkuCapacity;
            }

            if (this.PlanName != null)
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Name = this.PlanName;
            }

            if (this.PlanPublisher != null)
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Publisher = this.PlanPublisher;
            }

            if (this.PlanProduct != null)
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Product = this.PlanProduct;
            }

            if (this.PlanPromotionCode != null)
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.PromotionCode = this.PlanPromotionCode;
            }

            if (this.UpgradePolicyMode != null)
            {
                if (vUpgradePolicy == null)
                {
                    vUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.UpgradePolicy();
                }
                vUpgradePolicy.Mode = this.UpgradePolicyMode;
            }

            if (this.RollingUpgradePolicy != null)
            {
                if (vUpgradePolicy == null)
                {
                    vUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.UpgradePolicy();
                }
                vUpgradePolicy.RollingUpgradePolicy = this.RollingUpgradePolicy;
            }

            if (this.AutoOSUpgrade.IsPresent)
            {
                if (vUpgradePolicy == null)
                {
                    vUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.UpgradePolicy();
                }
                vUpgradePolicy.AutomaticOSUpgrade = true;
            }

            if (this.OsProfile != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.OsProfile = this.OsProfile;
            }

            if (this.StorageProfile != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.StorageProfile = this.StorageProfile;
            }

            if (this.HealthProbeId != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.NetworkProfile == null)
                {
                    vVirtualMachineProfile.NetworkProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetNetworkProfile();
                }
                if (vVirtualMachineProfile.NetworkProfile.HealthProbe == null)
                {
                    vVirtualMachineProfile.NetworkProfile.HealthProbe = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();
                }
                vVirtualMachineProfile.NetworkProfile.HealthProbe.Id = this.HealthProbeId;
            }

            if (this.NetworkInterfaceConfiguration != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.NetworkProfile == null)
                {
                    vVirtualMachineProfile.NetworkProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetNetworkProfile();
                }
                vVirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations = this.NetworkInterfaceConfiguration;
            }

            if (this.BootDiagnostic != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.DiagnosticsProfile == null)
                {
                    vVirtualMachineProfile.DiagnosticsProfile = new Microsoft.Azure.Management.Compute.Models.DiagnosticsProfile();
                }
                vVirtualMachineProfile.DiagnosticsProfile.BootDiagnostics = this.BootDiagnostic;
            }

            if (this.Extension != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.ExtensionProfile == null)
                {
                    vVirtualMachineProfile.ExtensionProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetExtensionProfile();
                }
                vVirtualMachineProfile.ExtensionProfile.Extensions = this.Extension;
            }

            if (this.LicenseType != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.LicenseType = this.LicenseType;
            }

            if (this.AssignIdentity.IsPresent)
            {
                if (vIdentity == null)
                {
                    vIdentity = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIdentity();
                }
                vIdentity.Type = ResourceIdentityType.SystemAssigned;
            }


            var vVirtualMachineScaleSet = new PSVirtualMachineScaleSet
            {
                Overprovision        = this.Overprovision,
                SinglePlacementGroup = this.SinglePlacementGroup,
                Zones                 = this.Zone,
                Location              = this.Location,
                Tags                  = (this.Tag == null) ? null : this.Tag.Cast <DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value),
                Sku                   = vSku,
                Plan                  = vPlan,
                UpgradePolicy         = vUpgradePolicy,
                VirtualMachineProfile = vVirtualMachineProfile,
                Identity              = vIdentity,
            };

            WriteObject(vVirtualMachineScaleSet);
        }
Exemplo n.º 4
0
        public void TestVMScenarioWithPlan()
        {
            using (var context = UndoContext.Current)
            {
                context.Start();
                EnsureClientsInitialized();

                string imgRefId = GetPlatformOSImage(useWindowsImage: true);
                var rgName = TestUtilities.GenerateName(TestPrefix);
                string storageAccountName = TestUtilities.GenerateName(TestPrefix);
                string asName = TestUtilities.GenerateName("as");
                VirtualMachine inputVM;
                try
                {
                    var storageAccountOutput = CreateStorageAccount(rgName, storageAccountName);

                    var imageRef = new ImageReference 
                            { 
                               Publisher = "datastax",
                               Offer = "datastax-enterprise-non-production-use-only",
                               Sku = "sandbox_single-node",
                               Version = "latest",
                            };

                    var plan = new Microsoft.Azure.Management.Compute.Models.Plan
                    {
                        Publisher = imageRef.Publisher,
                        Product = imageRef.Offer,
                        Name = imageRef.Sku,
                    };
                    var vm1 = CreateVM(rgName, asName, storageAccountOutput, imgRefId, out inputVM, (vm) =>
                        {
                            vm.StorageProfile.SourceImage = null;
                            vm.StorageProfile.ImageReference = imageRef;
                            vm.Plan = plan; 
                        }                        
                        );

                    var getVMResponse = m_CrpClient.VirtualMachines.Get(rgName, inputVM.Name);
                    Assert.True(getVMResponse.StatusCode == HttpStatusCode.OK);
                    ValidateVM(inputVM, getVMResponse.VirtualMachine, Helpers.GetVMReferenceId(m_subId, rgName, inputVM.Name));

                    var listResponse = m_CrpClient.VirtualMachines.List(rgName);
                    Assert.True(listResponse.StatusCode == HttpStatusCode.OK);
                    ValidateVM(inputVM, listResponse.VirtualMachines.FirstOrDefault(x => x.Name == inputVM.Name),
                        Helpers.GetVMReferenceId(m_subId, rgName, inputVM.Name));

                }
                finally
                {
                    var deleteResourceGroupResponse = m_ResourcesClient.ResourceGroups.Delete(rgName);
                    Assert.True(deleteResourceGroupResponse.StatusCode == HttpStatusCode.OK);
                }
            }
        }
        private void Run()
        {
            // Sku
            Microsoft.Azure.Management.Compute.Models.Sku vSku = null;

            // Plan
            Microsoft.Azure.Management.Compute.Models.Plan vPlan = null;

            // UpgradePolicy
            Microsoft.Azure.Management.Compute.Models.UpgradePolicy vUpgradePolicy = null;

            // VirtualMachineProfile
            Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile vVirtualMachineProfile = null;

            // Identity
            Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIdentity vIdentity = null;

            if (this.MyInvocation.BoundParameters.ContainsKey("SkuName"))
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Name = this.SkuName;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("SkuTier"))
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Tier = this.SkuTier;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("SkuCapacity"))
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Capacity = this.SkuCapacity;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("PlanName"))
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Name = this.PlanName;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("PlanPublisher"))
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Publisher = this.PlanPublisher;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("PlanProduct"))
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Product = this.PlanProduct;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("PlanPromotionCode"))
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.PromotionCode = this.PlanPromotionCode;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("UpgradePolicyMode"))
            {
                if (vUpgradePolicy == null)
                {
                    vUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.UpgradePolicy();
                }
                vUpgradePolicy.Mode = this.UpgradePolicyMode;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("RollingUpgradePolicy"))
            {
                if (vUpgradePolicy == null)
                {
                    vUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.UpgradePolicy();
                }
                vUpgradePolicy.RollingUpgradePolicy = this.RollingUpgradePolicy;
            }

            if (vUpgradePolicy == null)
            {
                vUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.UpgradePolicy();
            }
            vUpgradePolicy.AutomaticOSUpgrade = this.AutoOSUpgrade.IsPresent;

            if (this.MyInvocation.BoundParameters.ContainsKey("DisableAutoRollback"))
            {
                if (vUpgradePolicy == null)
                {
                    vUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.UpgradePolicy();
                }
                if (vUpgradePolicy.AutoOSUpgradePolicy == null)
                {
                    vUpgradePolicy.AutoOSUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.AutoOSUpgradePolicy();
                }
                vUpgradePolicy.AutoOSUpgradePolicy.DisableAutoRollback = this.DisableAutoRollback;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("OsProfile"))
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.OsProfile = this.OsProfile;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("StorageProfile"))
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.StorageProfile = this.StorageProfile;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("HealthProbeId"))
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.NetworkProfile == null)
                {
                    vVirtualMachineProfile.NetworkProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetNetworkProfile();
                }
                if (vVirtualMachineProfile.NetworkProfile.HealthProbe == null)
                {
                    vVirtualMachineProfile.NetworkProfile.HealthProbe = new Microsoft.Azure.Management.Compute.Models.ApiEntityReference();
                }
                vVirtualMachineProfile.NetworkProfile.HealthProbe.Id = this.HealthProbeId;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("NetworkInterfaceConfiguration"))
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.NetworkProfile == null)
                {
                    vVirtualMachineProfile.NetworkProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetNetworkProfile();
                }
                vVirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations = this.NetworkInterfaceConfiguration;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("BootDiagnostic"))
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.DiagnosticsProfile == null)
                {
                    vVirtualMachineProfile.DiagnosticsProfile = new Microsoft.Azure.Management.Compute.Models.DiagnosticsProfile();
                }
                vVirtualMachineProfile.DiagnosticsProfile.BootDiagnostics = this.BootDiagnostic;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("Extension"))
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.ExtensionProfile == null)
                {
                    vVirtualMachineProfile.ExtensionProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetExtensionProfile();
                }
                vVirtualMachineProfile.ExtensionProfile.Extensions = this.Extension;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("LicenseType"))
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.LicenseType = this.LicenseType;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("Priority"))
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.Priority = this.Priority;
            }

            if (this.AssignIdentity.IsPresent)
            {
                if (vIdentity == null)
                {
                    vIdentity = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIdentity();
                }
                vIdentity.Type = ResourceIdentityType.SystemAssigned;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("IdentityType"))
            {
                if (vIdentity == null)
                {
                    vIdentity = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIdentity();
                }
                vIdentity.Type = this.IdentityType;
            }

            if (this.MyInvocation.BoundParameters.ContainsKey("IdentityId"))
            {
                if (vIdentity == null)
                {
                    vIdentity = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetIdentity();
                }
                vIdentity.IdentityIds = this.IdentityId;
            }

            var vVirtualMachineScaleSet = new PSVirtualMachineScaleSet
            {
                Overprovision            = this.MyInvocation.BoundParameters.ContainsKey("Overprovision") ? this.Overprovision : (bool?)null,
                SinglePlacementGroup     = this.MyInvocation.BoundParameters.ContainsKey("SinglePlacementGroup") ? this.SinglePlacementGroup : (bool?)null,
                ZoneBalance              = this.ZoneBalance.IsPresent ? true : (bool?)null,
                PlatformFaultDomainCount = this.MyInvocation.BoundParameters.ContainsKey("PlatformFaultDomainCount") ? this.PlatformFaultDomainCount : (int?)null,
                Zones                 = this.MyInvocation.BoundParameters.ContainsKey("Zone") ? this.Zone : null,
                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,
                Sku                   = vSku,
                Plan                  = vPlan,
                UpgradePolicy         = vUpgradePolicy,
                VirtualMachineProfile = vVirtualMachineProfile,
                Identity              = vIdentity,
            };

            WriteObject(vVirtualMachineScaleSet);
        }
Exemplo n.º 6
0
        private void Run()
        {
            // Sku
            Microsoft.Azure.Management.Compute.Models.Sku vSku = null;

            // Plan
            Microsoft.Azure.Management.Compute.Models.Plan vPlan = null;

            // UpgradePolicy
            Microsoft.Azure.Management.Compute.Models.UpgradePolicy vUpgradePolicy = null;

            // VirtualMachineProfile
            Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile vVirtualMachineProfile = null;

            if (this.SkuName != null)
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Name = this.SkuName;
            }

            if (this.SkuTier != null)
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Tier = this.SkuTier;
            }

            if (this.SkuCapacity != null)
            {
                if (vSku == null)
                {
                    vSku = new Microsoft.Azure.Management.Compute.Models.Sku();
                }
                vSku.Capacity = this.SkuCapacity;
            }

            if (this.PlanName != null)
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Name = this.PlanName;
            }

            if (this.PlanPublisher != null)
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Publisher = this.PlanPublisher;
            }

            if (this.PlanProduct != null)
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.Product = this.PlanProduct;
            }

            if (this.PlanPromotionCode != null)
            {
                if (vPlan == null)
                {
                    vPlan = new Microsoft.Azure.Management.Compute.Models.Plan();
                }
                vPlan.PromotionCode = this.PlanPromotionCode;
            }

            if (this.UpgradePolicyMode != null)
            {
                if (vUpgradePolicy == null)
                {
                    vUpgradePolicy = new Microsoft.Azure.Management.Compute.Models.UpgradePolicy();
                }
                vUpgradePolicy.Mode = this.UpgradePolicyMode;
            }

            if (this.OsProfile != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.OsProfile = this.OsProfile;
            }

            if (this.StorageProfile != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                vVirtualMachineProfile.StorageProfile = this.StorageProfile;
            }

            if (this.NetworkInterfaceConfiguration != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.NetworkProfile == null)
                {
                    vVirtualMachineProfile.NetworkProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetNetworkProfile();
                }
                vVirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations = this.NetworkInterfaceConfiguration;
            }

            if (this.Extension != null)
            {
                if (vVirtualMachineProfile == null)
                {
                    vVirtualMachineProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetVMProfile();
                }
                if (vVirtualMachineProfile.ExtensionProfile == null)
                {
                    vVirtualMachineProfile.ExtensionProfile = new Microsoft.Azure.Management.Compute.Models.VirtualMachineScaleSetExtensionProfile();
                }
                vVirtualMachineProfile.ExtensionProfile.Extensions = this.Extension;
            }


            var vVirtualMachineScaleSet = new VirtualMachineScaleSet
            {
                Overprovision        = this.Overprovision,
                SinglePlacementGroup = this.SinglePlacementGroup,
                Location             = this.Location,
                Tags                  = (this.Tag == null) ? null : this.Tag.Cast <DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value),
                Sku                   = vSku,
                Plan                  = vPlan,
                UpgradePolicy         = vUpgradePolicy,
                VirtualMachineProfile = vVirtualMachineProfile,
            };

            WriteObject(vVirtualMachineScaleSet);
        }
 /// <summary>
 /// Initializes a new instance of the VirtualMachineScaleSetUpdate
 /// class.
 /// </summary>
 /// <param name="tags">Resource tags</param>
 /// <param name="sku">The virtual machine scale set sku.</param>
 /// <param name="plan">The purchase plan when deploying a virtual
 /// machine scale set from VM Marketplace images.</param>
 /// <param name="upgradePolicy">The upgrade policy.</param>
 /// <param name="virtualMachineProfile">The virtual machine
 /// profile.</param>
 /// <param name="overprovision">Specifies whether the Virtual Machine
 /// Scale Set should be overprovisioned.</param>
 /// <param name="singlePlacementGroup">When true this limits the scale
 /// set to a single placement group, of max size 100 virtual
 /// machines.</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="identity">The identity of the virtual machine scale
 /// set, if configured.</param>
 public VirtualMachineScaleSetUpdate(IDictionary <string, string> tags = default(IDictionary <string, string>), Sku sku = default(Sku), Plan plan = default(Plan), UpgradePolicy upgradePolicy = default(UpgradePolicy), VirtualMachineScaleSetUpdateVMProfile virtualMachineProfile = default(VirtualMachineScaleSetUpdateVMProfile), bool?overprovision = default(bool?), bool?singlePlacementGroup = default(bool?), AdditionalCapabilities additionalCapabilities = default(AdditionalCapabilities), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity))
     : base(tags)
 {
     Sku                    = sku;
     Plan                   = plan;
     UpgradePolicy          = upgradePolicy;
     VirtualMachineProfile  = virtualMachineProfile;
     Overprovision          = overprovision;
     SinglePlacementGroup   = singlePlacementGroup;
     AdditionalCapabilities = additionalCapabilities;
     Identity               = identity;
     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();
 }
Exemplo n.º 9
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
 /// 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="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), 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), VirtualMachineIdentity identity = default(VirtualMachineIdentity), IList <string> zones = default(IList <string>))
     : 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;
     ScheduledEventsProfile  = scheduledEventsProfile;
     UserData                = userData;
     CapacityReservation     = capacityReservation;
     ApplicationProfile      = applicationProfile;
     Identity                = identity;
     Zones                   = zones;
     CustomInit();
 }
Exemplo n.º 10
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
 /// 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 [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="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), 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), 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;
     SecurityProfile         = securityProfile;
     DiagnosticsProfile      = diagnosticsProfile;
     AvailabilitySet         = availabilitySet;
     VirtualMachineScaleSet  = virtualMachineScaleSet;
     ProximityPlacementGroup = proximityPlacementGroup;
     Priority                = priority;
     EvictionPolicy          = evictionPolicy;
     BillingProfile          = billingProfile;
     Host                    = host;
     ProvisioningState       = provisioningState;
     InstanceView            = instanceView;
     LicenseType             = licenseType;
     VmId                    = vmId;
     Identity                = identity;
     Zones                   = zones;
     CustomInit();
 }
Exemplo n.º 11
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.
 /// zoneBalance property can only be set if the zones property of the
 /// scale set contains more than one zone. If there are no zones or
 /// only one zone specified, then zoneBalance property should not be
 /// set.</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 policies applied when
 /// scaling in Virtual Machines in the Virtual Machine Scale
 /// Set.</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();
 }
 /// <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="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">In case of
 /// overprovisioning, determines whether extensions should be run
 /// immediately, or if they should be delayed until after
 /// overprovisioning has finished and the set of instances to keep have
 /// been selected.</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.</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="identity">The identity of the virtual machine scale
 /// set, if configured.</param>
 /// <param name="zones">The virtual machine scale set zones.</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), 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?), VirtualMachineScaleSetIdentity identity = default(VirtualMachineScaleSetIdentity), IList <string> zones = default(IList <string>))
     : base(location, id, name, type, tags)
 {
     Sku                   = sku;
     Plan                  = plan;
     UpgradePolicy         = upgradePolicy;
     VirtualMachineProfile = virtualMachineProfile;
     ProvisioningState     = provisioningState;
     Overprovision         = overprovision;
     DoNotRunExtensionsOnOverprovisionedVMs = doNotRunExtensionsOnOverprovisionedVMs;
     UniqueId                 = uniqueId;
     SinglePlacementGroup     = singlePlacementGroup;
     ZoneBalance              = zoneBalance;
     PlatformFaultDomainCount = platformFaultDomainCount;
     Identity                 = identity;
     Zones = zones;
     CustomInit();
 }
Exemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the VirtualMachineScaleSetVM class.
 /// </summary>
 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), Plan plan = default(Plan), IList <VirtualMachineExtension> resources = default(IList <VirtualMachineExtension>), bool?latestModelApplied = default(bool?), VirtualMachineInstanceView instanceView = default(VirtualMachineInstanceView), HardwareProfile hardwareProfile = default(HardwareProfile), StorageProfile storageProfile = default(StorageProfile), OSProfile osProfile = default(OSProfile), NetworkProfile networkProfile = default(NetworkProfile), DiagnosticsProfile diagnosticsProfile = default(DiagnosticsProfile), SubResource availabilitySet = default(SubResource), string provisioningState = default(string), string licenseType = default(string))
     : base(location, id, name, type, tags)
 {
     InstanceId         = instanceId;
     Sku                = sku;
     Plan               = plan;
     Resources          = resources;
     LatestModelApplied = latestModelApplied;
     InstanceView       = instanceView;
     HardwareProfile    = hardwareProfile;
     StorageProfile     = storageProfile;
     OsProfile          = osProfile;
     NetworkProfile     = networkProfile;
     DiagnosticsProfile = diagnosticsProfile;
     AvailabilitySet    = availabilitySet;
     ProvisioningState  = provisioningState;
     LicenseType        = licenseType;
 }
Exemplo n.º 14
0
 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, int?platformFaultDomain, ScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, IList <VirtualMachineExtension> resources, VirtualMachineIdentity identity, IList <string> zones)
     : 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;
     Resources               = resources;
     Identity                = identity;
     Zones                   = zones;
     CustomInit();
 }
Exemplo n.º 15
0
 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)
     : 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;
     CustomInit();
 }