Loading...

How to use the “Lab Services should restrict allowed virtual machine SKU sizes” Azure Policy?

How to use the “Lab Services should restrict allowed virtual machine SKU sizes” Azure Policy?

Let’s walkthrough how a lab administrator can allow only non-GPU SKUs, so educators can create only non-GPU SKU labs.

1. In Azure Portal, go to your subscription.

2. Select Policies under Settings.

3. Select Assignment under Authoring.

policy-compliance-page.png

 

 4. Select Assign Policy.

 

assign-policy.png

5. Select the Scope which you would like to assign the policy to. Optionally, you can select a resource group if you would like to apply it to a specific resource group.

6. Select the Policy Definition and search for “Lab Services” and select Lab Services should restrict allowed virtual machine SKU sizes.

7. Select Next.

 

policy-parameters.png

8. Uncheck the Only show parameters that need input or review to show all parameters.

9. The Allowed SKU names parameter shows SKU names and by default the SKU names applicable are selected . Uncheck the SKUs that shouldn’t be allowed. In our case we will check the following non-GPU SKUs: CLASSIC_FSV2_2_4GB_128_S_SSD, CLASSIC_FSV2_4_8GB_128_S_SSD, CLASSIC_FSV2_8_16GB_128_S_SSD, CLASSIC_DSV4_4_16GB_128_P_SSD, CLASSIC_DSV4_8_32GB_128_P_SSD. 

 

Use the table below to determine which SKU names to apply.

 

SKU Name VM Size VM Size Details

CLASSIC_FSV2_2_4GB_128_S_SSD

Small

2vCPUs, 4GB RAM, 128GB, Standard SSD

CLASSIC_FSV2_4_8GB_128_S_SSD

Medium

4vCPUs, 8GB RAM, 128GB, Standard SSD

CLASSIC_FSV2_8_16GB_128_S_SSD

Large

8vCPUs, 16GB RAM, 128 GB, Standard SSD

CLASSIC_DSV4_4_16GB_128_P_SSD

Medium (Nested virtualization)

4 vCPUs, 16GB RAM, 128 GB, Premium SSD

CLASSIC_DSV4_8_32GB_128_P_SSD

Large (Nested virtualization)

8vCPUs, 32GB RAM, 128GB, Premium SSD

CLASSIC_NCSV3_6_112GB_128_S_SSD

Small GPU (Compute)

6vCPUs, 112GB RAM, 128GB, Standard SSD

CLASSIC_NVV4_8_28GB_128_S_SSD

Small GPU (Visualization)

8vCPUs, 28GB RAM, 128GB, Standard SSD

CLASSIC_NVV3_12_112GB_128_S_SSD

Medium GPU (Visualization)

12vCPUs, 112GB RAM, 128GB, Standard SSD

 

10. For the Effect, choose the Deny Choosing deny will prevent a lab from even being created if an educator tries to create a lab with a GPU SKU.

11. Select Next

policy-remediation.png

12. On the Remediation tab, select Next

policy-non-compliance-msg.png

13. For the Non-compliance message, provide a non-compliance message of your choice. For example, "selected SKU is not allowed".

14. Select Next

policy-review-create.png

 15. On the Review + Create tab, select Create to create the policy assignment.

 

We have successfully created a policy assignment for “Lab Services should restrict allowed virtual machine SKU sizes” and allowed only to use non-GPU SKUs for labs. Creating a lab with any other SKU will fail and would not be created.  The policy assignment takes 30 minutes to take effect.

 

Exclusions

When applying a built-in policy, you can choose to exclude certain resources.  For example, if the scope of your policy assignment is a subscription, you can exclude resources in a resource group.  This is set using the Exclusions property on the Basics tab when creating a policy definition.

 

However, if you need to exclude a lab plan from a policy assignment the steps are different.  The exclusions scope shown in the Basics tab while assigning the policy doesn’t support lab plans.

 

If you would like to exclude a lab plan resource, you will first need to get the resource id of the lab plan.  To get the resource id for the lab plan resource that you want to exclude, do the following: 

1. Open the lab plan resource in the Azure portal.

2. Under Settings, select the Properties page.

3. Under the Essentials, copy the Id property.

 

id-property.png

 When creating a policy assignment, enter the lab plan to exclude on the Parameters tab.

4. On the Parameters tab, uncheck Only show parameters that need input or review. For Lab Plan Id to exclude, enter the previously copied resource id of the lab plan. 

policy-exclude.png

 

Thanks,

Lab Services Team

 

Published on:

Learn more
Need help with this product?

We can help you with How to use the “Lab Services should restrict allowed virtual machine SKU sizes” Azure Policy?

If you want help implementing, troubleshooting, or improving this product, contact us and we’ll point you in the right direction.

Azure Lab Services articles
Azure Lab Services articles

Azure Lab Services articles

Share post:

Related posts

ISSUE RESOLVED: Azure Lab Services - lab plan outage - September 12, 2024

Hello, Azure Lab Services is currently experiencing an outage affecting customers using Lab Plans for their service. Customers using Lab Accou...

1 year ago

Azure Lab Services - Upcoming maintenance update on October 12, 2024

Hello all,   On October 12th, 2024, we will be updating our system between 7:00 AM and 6:00 PM CST. This maintenance will only affect the...

1 year ago

Azure Lab Services - lab plan outage - September 12, 2024

Hello, Azure Lab Services is currently experiencing an outage affecting customers using Lab Plans for their service. Customers using Lab Accou...

1 year ago

Azure Lab Services - Upcoming maintenance update on 08/24

Hi, We will be doing an update to the service on Saturday, August 24 starting at 12:30 pm PDT and ending at 11:59 pm PDT. The service is not g...

2 years ago

[Mitigated] Azure Lab Services - Maintenance update outage

Hi, We are experiencing a service outage due to ongoing maintenance since around July 21st, 4 pm PDT. The service is currently not available i...

2 years ago

Azure Lab Services - Maintenance update outage

Hi, We are experiencing a service outage due to ongoing maintenance since around July 21st, 4 pm PDT. The service is currently not available i...

2 years ago

[Mitigated] Azure Lab Services - Lab Plan Outage

Azure Lab Service is experiencing an outage that is affecting Lab Plans, but not Lab Accounts. This outage intermittently impacts all operatio...

2 years ago

Azure Lab Services Tutorial Video

This is a complete tutorial about Azure Lab Services' features. It walks through the steps of setting up a Lab Account, creating a Lab, and ac...

2 years ago

What's new in the Azure Lab Services

This is a presentation highlighting the new features introduced in the latest preview for Azure Lab Services.

2 years ago

Updates for Azure Lab Services

The product team has been busy working on fundamental improvements for the service to boost performance, reliability, and scalability. It has ...

2 years ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.