Lab 08 - Manage Virtual Machines (Task1~Task4)在Azure Portal作業







Task 1: Deploy zone-resilient Azure virtual machines by using the Azure portal

you will deploy two Azure virtual machines into different availability zones by using the Azure portal. Availability zones offer the highest level of uptime SLA for virtual machines at 99.99%. 
To achieve this SLA, you must deploy at least two virtual machines across different availability zones.





Search for and select Virtual machines, on the Virtual machines blade, click + Create, and then select in the drop-down Azure virtual machine. Notice your other choices.




On the Basics tab, in the Availability zone drop down menu, place a checkmark next to Zone 2. This should select both Zone 1 and Zone 2.

做lab發現有ZON不知問題就照他提示的替換。




completing the configuration:


Click Next: Disks > , specify the following settings (leave others with their default values):

這邊OS Disk Space可選到以下這些範圍
Disk Type則如下

Key management

Click Next: Networking > take the defaults but do not provide a load balancer.


Click Next: Management > and specify the following settings (leave others with their default values):


Patch orchestration options 其實有這些選項
Click Next: Monitoring > and specify the following settings (leave others with their default values):












Task 2: Manage compute and storage scaling for virtual machines

On the az104-vm1 virtual machine, in the Availability + scale blade, select Size.

Note: Choose another size if Standard DS1_v2 is not available. Resizing is also known as vertical scaling, up or down.




In the Settings area, select Disks.




Under Data disks select + Create and attach a new disk. Configure the settings (leave other settings at their default values). Click Apply.
如果這邊Storage Type選成HDD 後面還是可以調整。




After the disk has been created, click Detach (if necessary, scroll to the right to view the detach icon), and then click Apply.
Note: Detaching removes the disk from the VM but keeps it in storage for later use.
and then click Apply.





Search for and select Disks. From the list of disks, select the vm1-disk1 object.





Set the storage type to Standard SSD, and then click Save.


Navigate back to the az104-vm1 virtual machine and select Disks.


In the Data disk section, select Attach existing disks.
In the Disk name drop-down, select VM1-DISK1.

Select Apply to save your changes.
Note: You have now created a virtual machine, scaled the SKU and the data disk size. In the next task we use Virtual Machine Scale Sets to automate the scaling process.



Task 3: Create and configure Azure Virtual Machine Scale Sets

In this task, you will deploy an Azure virtual machine scale set across availability zones. VM Scale Sets reduce the administrative overhead of automation by enabling you to configure metrics or conditions that allow the scale set to horizontally scale, scale in or scale out.


In the Azure portal, search for and select Virtual machine scale sets and, on the Virtual machine scale sets blade, click + Create.



Create a Virtual Machine Scale Set (VMSS)



Security type refers to the different security features available for a virtual machine. 
Security features like Trusted launch and Confidential virtual machines help to improve the security of Azure generation 2 virtual machines. However, additional security features have some limitations, which include not supporting back up, managed disks, and ephemeral OS disks. 



調整zone複選項目
Orchestration mode 分成
Flexible: achieve high availability at scale with identical or multiple virtual machine types
Uniform: optimized for large scale stateless workloads

Choose how virtual machines are managed by the scale set. In flexible orchestration mode, you manually create and add a virtual machine of any configuration to the scale set. In uniform orchestration mode, you define a virtual machine model and Azure will generate identical instances based on that model.


On the Spot tab, accept the defaults and select Next: Disks >.

On the Disks tab, accept the default values and click Next : Networking >.


On the Networking page, select Edit virtual network link. Make a few changes. When finished, select OK.






In the Networking tab, click the Edit network interface icon to the right of the network interface entry.


On the Create network security group blade, specify the following settings (leave others with their default values):


Click Add an inbound rule and add an inbound security rule with the following settings (leave others with their default values):

Click Add and, back on the Create network security group blade, click OK.



In the Edit network interface blade, in the Public IP address section, click Enabled and click OK.

In the Networking tab, under the Load balancing section, specify the following (leave others with their default values).
On the Create a load balancer page, specify the load balancer name and take the defaults. Click Create when you are done then Next : Management >.

Note: Pause for a minute and review what you done. At this point, you have configured the virtual machine scale set with disks and networking. In the network configuration you have created a network security group and allowed HTTP. You have also created a load balancer with a public IP address.

On the Management tab, specify the following settings (leave others with their default values):


On the Health tab, review the default settings without making any changes and click Next : Advanced >.


On the Advanced tab, click Review + create.

Note: Wait for the virtual machine scale set deployment to complete. This should take approximately 5 minutes.




Task 4: Scale Azure Virtual Machine Scale Sets

In this task, you scale the virtual machine scale set using a custom scale rule.

Choose Availability + Scale from the left side menu, then choose Scaling.

Scale out rule


You can Manual scale or Custom autoscale. 
  • In scale sets with a small number of VM instances, increasing or decreasing the instance count (Manual scale) may be best. 
  • In scale sets with a large number of VM instances, scaling based on metrics (Custom autoscale) may be more appropriate.

Select Custom autoscale. Then change the Scale mode to Scale based on metric
And then select Add a rule.

Scale is based on metric trigger rules but no rule(s) is defined; click Add a rule to create a rule. For example: 'Add a rule that increases instance count by 1 when CPU Percentage is above 70%'. If no rules is defined, the resource will be set to default instance count.

Let's create a rule that automatically increases the number of VM instances. This rule scales out when the average CPU load is greater than 70% over a 10-minute period. When the rule triggers, the number of VM instances is increased by 50%.


Metric name :  review  other choices
Operation 選項有不同排序依據



Be sure to Add then Save your changes.
Scale in rule

During evenings or weekends, demand may decrease so it is important to create a scale in rule.

Let's create a rule that decreases the number of VM instances in a scale set. The number of instances should decrease when the average CPU load drops below 30% over a 10-minute period. When the rule triggers, the number of VM instances is decreased by 20%.


Be sure to Save your changes.

Set the instance limits

When your autoscale rules are applied, instance limits make sure that you do not scale out beyond the maximum number of instances or scale in beyond the minimum number of instances.

Instance limits are shown on the Scaling page after the rules.


Note: If you are interested in using Azure PowerShell for virtual machine creation, try Task 5. If you are interested in using the CLI to create virtual machines, try Task 6.




Learn more with self-paced training Ref:

Create a Windows virtual machine in Azure. Create a Windows virtual machine using the Azure portal. Connect to a running Windows virtual machine using Remote Desktop


Build a scalable application with Virtual Machine Scale Sets. Enable your application to automatically adjust to changes in load while minimizing costs with Virtual Machine Scale Sets.


Connect to virtual machines through the Azure portal by using Azure Bastion. Deploy Azure Bastion to securely connect to Azure virtual machines directly within the Azure portal to effectively replace an existing jumpbox solution, monitor remote sessions by using diagnostic logs, and manage remote sessions by disconnecting a user session.



留言

這個網誌中的熱門文章

何謂淨重(Net Weight)、皮重(Tare Weight)與毛重(Gross Weight)

(2021年度)駕訓學科筆試準備題庫歸納分析_法規是非題

Architecture(架構) 和 Framework(框架) 有何不同?_軟體設計前的事前規劃的藍圖概念