Azure – WVD Image Update and Deployment

Notes: 

  1. Windows 10 only allows you to run Sysprep 8 times. A snapshot of the VM disk was created before Sysprep was ran. The snapshot will be used to recreate the VM and update the image.
  2. You can either update your current VM’s manually or deploy new VM’s with your updated golden image.
  3. This procedure does not apply to WVD’s ephemeral disks.
  4. This procedure assumes that you’re starting from an existing WVD environment with an already existing image.

Quick Step List

  • Note your current image version
  • Create VM From Snapshot
  • Update VM
  • Create Snapshot of VM Disk
  • Sysprep VM
  • Update VM Custom Image
  • Add new VM's to WVD Host Pool from the new image
  • Drain users off old VM’s

Find your current image version

1. Search for "shared image galleries" in the search bar and go to the "Shared image galleries" blade.


p image 
Services 
Shared image galleries 
Images 
Image definitions


2. Drill down into your "Shared Image Gallery" resource


Showing 1 to 1 of 1 records. 
Name 
SharedlmageGallery


3. Drill down into your WVD "Image definition"


a SharedlmageGallery 
Shared image gallery 
earch (Ctrl+/) 
Overview 
Activity log 
Access control (IAM) 
Tags 
Diagnose and solve problems 
Settings 
Properties 
Locks 
Automation 
Tasks (preview) 
Add new image definition Delete 
A Essentials 
Resource group (change) 
CD Refresh 
Status 
Location 
Subscription (change) 
Subscription ID 
Tags (change) 
Succeeded 
Canada Central 
Microsoft Azure 
Click here to add tags 
p Search image definitions 
Name 
WVD-Goldenlmege-50gb


4. Take a note of your existing versions and your most recent version


Tags (change) 
p Search image versions 
Name 
0.0.1 
00.2

Create VM From Snapshot

1. Log into the Azure Portal


2. In the top Search bar type ‘disks’ and then click it

 


3. Click the + Add button to add a new disk

 


4. Complete the following sections

  • Resource group: EnterName-RG
  • Disk name: ServerName_OsDisk
  • Source type: Snapshot
  • Source snapshot: Select the snapshot created from your WVD VM
  • Size: Change size to P10 128 GiB (Or whatever size the snapshot disk was)

 


5. Click Review + create button then Create


6. Once completed click the Go to resource button (Or go click on the new disk that was created under Disks)


7. Click the button + Create VM

 

 

8. Set the following:

  • VM name: ServerName
  • Size: Anything since its just updating the image
  • Public inbound ports: None
  • License type: Windows client
  • Check box: I confirm I have an eligible Windows 10 license with multi-tenant hosting rights


9. Click Next: Disks (Nothing needs to be changed here)


10. Click Next: Networking

  • Virtual Network: Vnet for the VM
  • Subnet: Subnet for the VM
  • Public IP: None

 

 

11. Click Next: Management 

  • Monitoring: Disable

 

12. Click Review + Create and then Create

Update VM

1. RDP to the VM and make updates

Create Snapshot of VM Disk

1. Power off and deallocate the VM


2. Click on the VM in the Azure Portal


3. Click Disks


4. Click on the disk ServerName_OsDisk


5. Click the + Create snapshobutton

 

 

6. Set the following:

  • Name: WVD-Win10MS-Year-Month-Day-BeforeSysprep
  • Storage type: Standard HDD

 

 

7. Click Review + create button then Create

Sysprep VM

1. Power on the VM and RDP to it


2. Go to C:\Windows\System32\Sysprep and run sysprep.exe


3. Select the settings shown in the image and click OK

 

Update VM Custom Image

1. After the Virtual Machine has powered off, deallocate the Virtual Machine (Click on the VM in the Azure Portal and click Stop). 


2. After the Virtual Machine shows Stopped (deallocated), click on Capture

 

 

3. Set the following:

  • Check Box: Automatically delete this virtual machine after creating the image
  • Target image gallery: Select the name of your Shared Image Gallery
  • Target image definition: Enter the server name with -IMG or select existing image definition
  • Version number: Anything higher than the latest image version number noted earlier


 

4. Click Review + create and then Create

Add new VM's to WVD Host Pool from the new image

1. In the Azure Portal search for MoesHome-Pool and click the resource

 

 

2. Click on Registration key 

 

 

3. Click Generate new key


4. Enter a date and time for the key and click OK (Just long enough to add the new VM)

 

 

5. Copy the key generated and close out the registration


6. Click on Session hosts then click + Add button

 

 

7. Next click the Next: Virtual Machines button

 

 

8. Set the following:

  • Virtual machine location: Select the VM location
  • Image: ServerName-IMG (If this isn’t listed click See all images, My items, Shared Images)
  • Number of VMs: Enter how many you want to create
  • Virtual network: Select VM Vnet
  • Subnet: Select VM subnet
  • Specify domain or unit: Yes
  • Domain to join: Enter your domain name (abc.local)
  • AD domain join UPD: Enter a user that has rights to join the VM to the domain (sysadmin@abc.local)
  • Password: Enter password for user above
  • Username: Enter name for local admin user on VM
  • Password: Enter password to use for the local admin user above and in confirm box

 

 

9. Click the Review + create button and then Create

 

After the deployment is finished, the new servers are added to the Windows Virtual Desktop Host pool, created with the latest version of the custom image. You can drain the users off the old VM’s and test the new VM’s. If everything is working as expected you can then delete the old VM’s. You can also delete the old snapshot of the VM since you have a new one.

Drain users off old VM’s

1. Under Pool name click on Session hosts


2. Click on the old WVD VM you want to drain and set Drain mode to On

 

 

3. Complete the same process on the next old WVD VM