Monitoring Virtual Machines with the Portal

Total Page:16

File Type:pdf, Size:1020Kb

Monitoring Virtual Machines with the Portal

Hands on Lab

Monitoring Virtual Machines with the Portal

August 2014 CONTENTS Contents

Overview In this lab, you will show how to configure a set of servers for endpoint and performance counter monitoring. From there you will configure alerts and show how to create a custom image to make it simple to create identical virtual machines. Once the image is created, you will create multiple virtual machines to demonstrate configuration of auto-scale rules.

Objectives 1. This demo will show how to: Create a SQL Server Virtual Machine

Create a Virtual Machine

System requirements 1. You must have the following to complete this demo: A reliable Internet connection

An active Microsoft Azure subscription

You must have ran the setup script in C:\PPEContent\Module-08-Management and Monitoring\SAMPLES\CreateVMs Script.

1. Estimated time to complete this lab: 45 Minutes

Exercise 1 – Application Deployment

Task 1 – Copy Sample Application to Each Virtual Machine 1. In the Azure Management Portal click Virtual Machines on the left.

Page 2 2. Select monitorvm1 an click CONNECT

3. Login with the credentials specified during virtual machine creation: 3.a. Username: demouser 3.b.Password: demo@pass1

4. Once logged in, copy the CPUSpikeApp.zip file from C:\PPEContent\Module-08- Management and Monitoring\SAMPLES\CPUSpikeApp over remote desktop (CTRL-C then CTRL-V) to C:\Inetpub\wwwroot on the monitorvm1 virtual machine. 5. Unzip the file to the C:\InetPub\wwwroot folder.

6. Repeat steps 1-5 on monitorvm2.

7. Validate that the application loads by copying the DNS name from one of the virtual machine's dashboard into your browser. Refresh multiple times to ensure that monitorvm1 and monitorvm2 show up on the home page.

Exercise 2 – Configuring Monitoring

Task 1 – Enabling Web Endpoint Monitoring

Page 3 1. Open the Dashboard for the virtual machine monitorvm1 and click on the CONFIGURE WEB ENDPOINT MONITORING link.

2. Select three test locations and specify http for the name.

3. Press SAVE button at the bottom of the screen to continue

Task 2 – Configure Metrics and Alerts 1. Click the MONITOR tab for monitorvm1. 2. Click the ADD METRICS button next to add additional metrics from the web endpoint monitoring. 3. On the dialog that opens, click the ENDPOINTS link.

4. Check the checkboxes for uptime by each of the data centers you are using to monitor your endpoint.

Page 4 5. Press the check mark to confirm that you are now monitoring up time. 6. Select CPU Percentage and click ADD RULE.

7. On the Define Alert screen, specify High CPU for the name and Description. Click the right arrow to continue.

Page 5 8. On the Define a condition for notifications page, choose greater than for the condition and 80 for the threshold value. Select Average over the last 5 minutes and mark the checkbox for Send and email to the service administrator and co-administrators.

9. Click the check mark to save the rule settings. 10. Select one of the Uptime metrics for one the data centers you have selected and choose ADD RULE.

Page 6 11. Give a name and description for the alert and click the right arrow to continue.

12. Specify less than for the condition and 95 for the THRESHOLD VALUE and ensure that Send an e-mail to the service administrator and co-administrators is checked.

Exercise 3 – Creating an Image for Auto Scaling

Task 1 – Sysprep a Virtual Machine

Page 7 1. Open the Dashboard for the virtual machine monitorvm2 and click on the CONNECT button and login with the credentials used to create the virtual machine. 2. Press and type in the following command: C:\Windows\System32\Sysprep\sysprep.exe 3. When the System Preperation Tool dialog opens, check Generalize and change the Shutdown Options dropdown to Shutdown then press OK.

Task 2 – Capture the custom image.

1. In the VIRTUAL MACHINES view, wait until monitorvm2 is in the Stopped state. Once it is Stopped, select the virtual macine and click CAPTURE.

2. Specify a name for the image such as monitordemoimg and check I have run Sysprep on the virtual machine, then click the check mark to complete the image creation process.

Page 8 Task 3– Create Virtual Machine Instances for Auto Scale

1. In the Azure Management Portal click COMPUTE, VIRTUAL MACHINE, FROM GALLERY.

2. On the Choose an Image screen click MY IMAGES and select the custom image previously created. Click the right arrow to continue.

Page 9 3. Name the virtual machine monitorvm2 and specify the demouser and demo@pass1 credentials.

4. With the CLOUD SERVICE dropdown, select the cloud service that monitorvm1 is deployed in. Ensure you also select the IISAVSET availability set.

Page 10 5. Accept the default values for endpoints and click the check mark to create the virtual machine.

6. Once the virtual machine is in the Starting (Provisioning) state repeat 1-5 and create monitorvm3. Ensure after creating each virtual machine that you briefly pause to allow the previous virtual machine to move to the Starting (Provisioning) state. 7. Once the virtual machines are all created starting with monitorvm2 add the load balanced endpoint to each virtual machine. 7.a. Open up the endpoints tab and click ADD button at the bottom of the screen. 7.b.Select ADD AN ENDPOINT TO AN EXISTING LOAD-BALANCED SET and click the right arrow.

7.c. Specify HTTP for the NAME and click the check mark to save the endpoint.

Page 11 7.d.Repeat for monitorvm3 (Note: before moving on to the next virtual machine allow the endpoint update to complete).

Task 4 – Configure Auto Scale Properties 1. Open the dashboard for monitorvm1 and click CONFIGURE AUTOSCALE.

2. Change SCALE BY METRIC to CPU. 3. Specify the following settings 3.a. INSTANCE RANGE: 1 minimum and 3 maximum 3.b.SCALE UP BY: 2 instances 3.c. SCALE UP/DOWN WAIT TIME: 5 minutes

4. Click the SAVE button to save the auto-scale configuration. 5. Stop monitorvm2 and monitorvm3 (this will happen automatically but this will speed up the expected behavior).

Task 5 – Simulate CPU Activity 1. Open the dashboard to monitorvm1, then copy the DNS name and launch it in a browser.

Page 12 2. Press the Spike CPU button is open using the default settings.

Task 6 – Validate Results 1. Auto-Scale works from an average of data that can take up to 45 minutes to trigger initial scale changes. Throughout the next hour, periodically check to see if monitorvm2 and monitorvm3 has started.

Summary

1. In this hands on lab you learned how to enable outside in monitoring using the web endpoint monitoring feature. You then learned how to add additional metrics such as Uptime and configure alerts based on configurable values. Finally, you learned how to create custom virtual machine images for simplified application deployment and to configure auto- scale for elastic scalability.

Page 13

Recommended publications