Azure VM Scale Set Starter Series (2) - to create a scale set by pre-configured custom image

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;

  1. Open the "Command Prompt" window as an administrator.  Change directory to% windir% \ system32 \ sysprep, then run  sysprep.exe.

  2. In the "System Preparation Tool" dialog box, select the "Enter System experience (OOBE)", and select the "universal" check box.

  3. Select "Shutdown" in the "Shutdown Options".

  4. Select "OK."

    Start Sysprep

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:

img-e890637c-f921-4c2c-9027-0fd6fcd3e7f1.png

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.

img-6a37c066-5501-4950-9b9e-b5bc6421ddca.png

 

Wait a few minutes, you can see to create a good "image"

img-3d685880-2d1f-42be-bb80-0dab60757352.png

 

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.

img-3e2fed6a-559b-4c7a-bf5e-3217105414f0.png

 

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:

img-ef5bbc5d-8ed1-4a86-999f-6fff1069701f.png

 

img-e9579494-7b92-4a01-a55d-81a6ad032d05.png

 

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:

img-db262672-c059-4377-bb47-f2035c223d9f.png

 

Revisit the Web site may appear to load balance the traffic load is unreasonable to case a virtual machine:

img-be692e13-3c06-443b-848d-f6b037b78ff6.png


Guess you like

Origin blog.51cto.com/10117438/2477914