Azure VM Scale Set Starter Series (2) - to create a scale set by pre-configured custom image
Last lecture, we have created a virtual machine image Azure scale set by the market, this section, we used pre-configured custom image creation set scale:
1. Install the software in preconfigured template virtual machine, such as Java, Tomcat, etc.
In this example, we installed IIS, and then configure a static Web site;
2. Place the template virtual machine is configured as a general purpose virtual machine;
3. Create a custom image;
4. Create a virtual machine set the scale, select the image you just created a good custom image;
5. Adoption of IP load balancing public access to the site;
6. Change the back-end web pages to a server, observe the effect of the load balancer;
Video Tutorial:
You can watch a video explaining the B station: https://www.bilibili.com/video/av95017520/
Or watch the video on this site: https://www.51azure.cloud/post/2020/2/16/azure-list
Photo explanation:
On how to create a custom image, you can refer to the article " Fun Azure VM (1) - Virtual machine" copy "of the image by creating a virtual machine on the Portal "
1. Prepare a Windows server virtual machine
Log virtual machine and install IIS and deploy a sample site via Power Shell scripts are as follows:
# install IIS server role Install-WindowsFeature -name Web-Server -IncludeManagementTools # remove default htm file remove-item C:\inetpub\wwwroot\iisstart.htm # Add a new htm file that displays server name Add-Content -Path "C:\inetpub\wwwroot\iisstart.htm" -Value $("Hello World from " + $env:computername)
2. Place the template virtual machine is configured as a general purpose virtual machine;
Execute Sysprep generalization Windows VM;
Open the "Command Prompt" window as an administrator. Change directory to% windir% \ system32 \ sysprep, then run
sysprep.exe
.In the "System Preparation Tool" dialog box, select the "Enter System experience (OOBE)", and select the "universal" check box.
Select "Shutdown" in the "Shutdown Options".
Select "OK."
This operation will perform with the virtual machine operating.
3. Create a custom image;
Capture "image";
In the virtual machine overview page, click on the Capture button:
Note that the capture operation will contact dispensing virtual machine, and, before the virtual machine because doing the universal, can not boot up, where you can delete the virtual machine, note that the deletion does not delete the virtual machine IP, disk and so on.
Wait a few minutes, you can see to create a good "image"
4. Create a virtual machine set the scale, select the image you just created a good custom image;
When you create, select Private Image - my term - custom image;
Note that the size of the new virtual machine must be set and custom images in the same area, can not be changed.
The remaining steps, please refer to the previous section.
5. Adoption of IP load balancing public access to the site;
Using the public IP address of the load balancer is accessed:
6. Change the back-end web pages to a server, observe the effect of the load balancer;
Log in to a virtual machine through NAT inbound rule, modify site content:
Revisit the Web site may appear to load balance the traffic load is unreasonable to case a virtual machine: