Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1048762%22%20slang%3D%22en-US%22%3EStep-By-Step%3A%20Building%20a%20Hyper-V%20Lab%20in%20Azure%20with%20Windows%20Server%202019%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1048762%22%20slang%3D%22en-US%22%3E%3CP%3EI%20was%20recently%20challenged%20with%20having%20to%20create%20technical%20demos%20for%20a%20Microsoft%20Ignite%20the%20tour%20session%20called%20%E2%80%9C%3CSTRONG%3EMigrating%20to%20Windows%20Server%202019%3C%2FSTRONG%3E%E2%80%9D%20%3CA%20href%3D%22https%3A%2F%2Fmyignite.techcommunity.microsoft.com%2Fsessions%2F82966%3FWT.mc_id%3Ditopstalk-blog-rclaus%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E(watch%20the%20recording%20here%3C%2FA%3E%20-%20awesome%20session).%20The%20demos%20for%20this%20talk%20centered%20around%20taking%20a%20bunch%20of%20Windows%20Server%202008%20R2%20systems%20running%20%E2%80%9Ccore%20infrastructure%20services%E2%80%9D%20(Active%20Directory%2C%20DHCP%20and%20File%20Servers)%20and%20moving%20those%20workloads%20over%20to%20systems%20running%20Windows%20Server%202019.%20This%20was%20simulating%20an%20on-prem%20environment%20that%20was%20going%20through%20a%20modernization%20process.%26nbsp%3B%20I%E2%80%99ve%20been%20making%20technical%20demos%20for%20a%20long%20time%20now%20%E2%80%93%20so%20it%20should%20have%20been%20easy%20to%20pull%20off.%20Fire%20up%20my%20Hyper-V%20lab%20server%20and%20make%20some%20VMs.%20%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%20it%20hit%20me.%20I%20no%20longer%20have%20a%20Hyper-V%20Lab%20server%20kicking%20around%20I%20can%20use%20as%20my%20demo%20platform.%20I%20had%20recycled%20my%20old%20home%20lab%20when%20I%20changed%20jobs%20close%20to%205%20years%20ago%20to%20go%20work%20in%20Azure%20Compute.%20My%20daily%20driver%20laptop%20was%20a%20little%20anemic%20on%20the%20RAM%20side%20to%20run%206-8%20VMs%20and%20I%20need%20to%20take%20snapshots%20%2F%20checkpoints%20at%20various%20points%20in%20the%20building%20process%20in%20order%20to%20test%20and%20optimize%20the%20demo%20flow.%20What%E2%80%99s%20an%20IT%20Pro%20to%20do%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F160190iA18491BC5CE5B392%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_0.jpeg%22%20title%3D%22clipboard_image_0.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20check%20the%20lower%20left%20side%20of%20my%20laptop%20stickers%20%E2%80%93%20you%E2%80%99ll%20see%20a%20quote%20%E2%80%9Cmy%20other%20computer%20is%20an%20Azure%20datacenter%E2%80%9D.%20Why%20not%20harness%20this%20on%20demand%20power%20and%20only%20pay%20for%20what%20I%20use%3F%26nbsp%3B%20Let%20me%20share%20with%20you%20a%20recipe%20for%20what%20I%20built%2C%20how%20I%20securely%20access%20it%20and%20what%20I%20did%20to%20minimize%20costs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1441156142%22%20id%3D%22toc-hId--1441156142%22%3EIngredients%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EAzure%20Subscription.%3C%2FSTRONG%3E%20Be%20forewarned%3A%20This%20will%20Hyper-V%20Host%20machine%20will%20%3CEM%3E%3CSTRONG%3ENOT%20fit%20inside%20a%20trial%20subscription%3C%2FSTRONG%3E%3C%2FEM%3E.%20You%20might%20need%20to%20request%20a%20quota%20increase%20(via%20for%20the%20machine%20type%20and%20core%20count%20for%20the%20region%20you%20choose.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EResource%20group%3A%3C%2FSTRONG%3E%20located%20in%20a%20region%20close%20to%20where%20you%20are.%20This%20will%20contain%20all%20the%20resources%20required%20for%20this%20setup%20and%20can%20be%20easily%20deleted%20if%20you%20so%20choose%20once%20complete.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ESuitable%20VM%20Size%3C%2FSTRONG%3E%20that%20has%20enough%20cores%2C%20RAM%20and%20disk%20attach%20to%20match%20performance%20you%20need%20to%20host%20machines.%20Go%20check%20out%20%3CA%20style%3D%22font-family%3A%20inherit%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fvirtual-machines%2Fwindows%2Fsizes-general%3FWT.mc_id%3Ditopstalk-blog-rclaus%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20VM%20Sizes%20documentation%3C%2FA%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%20for%20a%20complete%20list%20%E2%80%93%20I%20opted%20for%20a%20machine%20in%20the%20%3C%2FSPAN%3E%3CA%20style%3D%22font-family%3A%20inherit%3B%20background-color%3A%20%23ffffff%3B%22%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fvirtual-machines%2Fwindows%2Fsizes-general%23dsv3-series-1%3FWT.mc_id%3Ditopstalk-blog-rclaus%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGeneral%20Purpose%20Dsv3%20Series%20machines%3C%2FA%3E%3CSPAN%20style%3D%22font-family%3A%20inherit%3B%22%3E%20for%20my%20box%20based%20on%20the%20estimated%2064%20Gig%20of%20ram%20(8%20machines%2C%208%20GB%20each)%20with%20at%20least%202%20vCPU%20each%20(16%20cores)%20just%20for%20the%20VM%20load%20%E2%80%93%20plus%20the%20needed%20headroom%20for%20the%20host%20box.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%3CSTRONG%3ENote%3A%20%3C%2FSTRONG%3Ethis%20has%20to%20be%20one%20of%20the%20hyperthreaded%20%E2%80%9Cv3%E2%80%9D%20machine%20sizes%20in%20order%20to%20do%20paravirtualization.%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EA%20set%20of%20ISO%20files%3C%2FSTRONG%3E%20for%20Windows%20Server%202008R2%20and%20Windows%20Server%202019.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1046356691%22%20id%3D%22toc-hId-1046356691%22%3EStep-By-Step%3A%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3ETo%20keep%20this%20simple%20%E2%80%93%20I%20created%20a%20VM%20with%20the%20interactive%20Azure%20Portal%20experience.%20You%20can%20follow%20the%20basic%20steps%20by%20using%20the%20%E2%80%9C%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fazure%2Fvirtual-machines%2Fwindows%2Fquick-create-portal%3FWT.mc_id%3Ditopstalk-blog-rclaus%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECreate%20a%20Windows%20VM%20in%20the%20Azure%20Portal%3C%2FA%3E%E2%80%9D%20document%20%E2%80%93%20with%20the%20following%20CHANGES.%3CUL%3E%0A%3CLI%3ECreate%20your%20own%20unique%20Resource%20Group%20name%20and%20choose%20a%20convenient%20location%3C%2FLI%3E%0A%3CLI%3EChange%20the%20SIZE%20of%20the%20vm%20to%20meet%20your%20performance%20needs.%20I%20chose%20a%20%3CSTRONG%3EStandard%20D64s%20v3%20(64%20vcpus%2C%20256%20GiB%20memory)%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EChoose%20your%20own%20%3CSTRONG%3EAdministrator%20account%20and%20password%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EDO%20NOT%3C%2FSTRONG%3E%20configure%20any%20inbound%20networking%20ports%20at%20this%20time%3C%2FLI%3E%0A%3CLI%3EOn%20the%20%3CSTRONG%3EDisk%20page%3C%2FSTRONG%3E%2C%20I%20created%20and%20attached%20a%20new%20managed%20disk%20of%20%3CSTRONG%3E1%20TB%3C%2FSTRONG%3E%20in%20size%20based%20on%20%3CSTRONG%3Epremium%20SSD%3C%2FSTRONG%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EOnce%20provisioned%20and%20running%20%E2%80%93%20in%20the%20Azure%20portal%20I%20went%20to%20the%20overview%20page%20of%20the%20VM%20and%20clicked%20on%20the%20Connect%20button.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F160189i910F05DCFA10884A%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_1.png%22%20title%3D%22clipboard_image_1.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ERemember%20%E2%80%93%20%3CSTRONG%3Ethere%20are%20NO%20open%20ports%3C%2FSTRONG%3E%20to%20the%20internet%20because%20I%20asked%20for%20none%20to%20be%20opened%20when%20the%20VM%20was%20created.%20To%20make%20accessing%20this%20VM%20more%20secure%20I%20am%20going%20to%20enable%20J%3CSTRONG%3Eust-In-Time%3C%2FSTRONG%3E%20by%20clicking%20on%20the%20hyperlink%20above%20and%20clicking%20the%20button%20to%20enable%20it.%3C%2FLI%3E%0A%3CLI%3EOnce%20enabled%20%E2%80%93%20the%20default%20policy%20is%20for%20port%203389%20(RDP%20access)%20to%20be%20opened%20to%20a%20restricted%20IP%20address%20and%20only%20remain%20open%20for%203%20hrs.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F160188i009C1836090693AF%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_2.png%22%20title%3D%22clipboard_image_2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EClick%20on%20the%20%3CSTRONG%3ERequest%20Access%3C%2FSTRONG%3E%20button%2C%20once%20granted%2C%20download%20the%20RDP%20file%2C%20open%20it%20and%20logon%20to%20the%20remote%20Azure%20based%20VM%20with%20the%20credentials%20you%20specified%20during%20VM%20creation.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%3CSTRONG%3ENOTE%3A%3C%2FSTRONG%3E%20I%20am%20using%20RDP%20with%20JIT%20because%20I%20will%20be%20copying%20files%20between%20my%20workstation%20at%20work%2Fhome%20into%20the%20VM%20in%20Azure%20using%20the%20RDP%20client.%3C%2FP%3E%0A%3CP%20style%3D%22padding-left%3A%2060px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EOnce%20logged%20on%20to%20my%20remote%20%E2%80%9CHyper-V%20Lab%20Server%E2%80%9D%20in%20Azure%20%E2%80%93%20I%20needed%20to%20enable%20the%20Hyper-V%20role%20and%20start%20doing%20some%20paravirtualization.%20From%20a%20PS%20prompt%20on%20the%20machine%3A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EInstall-WindowsFeature%20-name%20hyper-v%2Crsat-hyper-v-tools%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ECreate%20a%20new%20Hyper-v%20switch%20for%20the%20demo%20environment%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ENew-VMSwitch%20-switchname%20%22NatSwitch%22%20-SwitchType%20internal%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EGet%20the%20ifIndex%20value%20of%20the%20new%20switch%20called%20%E2%80%9CNatSwitch%E2%80%9D%20(make%20note%20of%20it%20%E2%80%93%20mine%20was%2014)%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EGet-netadapter%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ESet%20a%20static%20IP%20address%20on%20the%20new%20Hyper-V%20Switch%20interface%20(use%20the%20ifIndex%20value%20for%20InterfaceIndex)%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ENew-NetIPAddress%20-IPAddress%20192.168.0.1%20-prefixLength%2024%20-InterfaceIndex%2014%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ESetup%20NAT%20for%20the%20hyper-v%20switch%20interface%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ENew-NetNat%20-name%20MyDemoNAT%20-InternalIPInterfaceAddressPrefix%20192.168.0.0%2F24%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThat%20basically%20does%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20now%20have%20a%20box%20that%20does%20Hyper-V%20with%20Management%20tools%20installed.%20It%20is%20the%20appropriate%20size%20to%20handle%20quick%20demo%20workloads%20and%20since%20it%E2%80%99s%20Hyper-V%2C%20it%20supports%20multiple%20checkpoints!%20You%20made%20it%20more%20secure%20to%20access%20by%20enabling%20Just-In-Time%20(JIT)%20requests%20for%20remote%20VM%20connectivity.%20This%20JIT%20connectivity%20is%20audited%20and%20enabled%20for%203%20hrs%2C%20after%20which%20time%20the%20JIT%20controlled%20Network%20Security%20Group%20allowing%20RDP%20access%20will%20be%20deleted.%20You%20have%20also%20created%20a%20new%20Hyper-V%20switch%20on%20which%20you%20can%20now%20create%20paravirtualized%20VMs%20with%20NAT%20connectivity%20to%20the%20internet%20in%20order%20to%20allow%20for%20Guest%20VMs%20download%20updates%2C%20tools%20and%20other%20things.%20Oh%20yeah%20%E2%80%93%20the%20internet%20speeds%20from%20a%20datacenter%20are%20WONDERFUL.%20%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--761097772%22%20id%3D%22toc-hId--761097772%22%3EBonus%20Section%3A%20Save%20Money%20and%20prevent%20accidental%20VM%20billing%3C%2FH2%3E%0A%3CP%3ETrust%20me%20%E2%80%93%20I%20have%20been%20there.%20I%20forget%20to%20spin%20down%20a%20VM%20in%20Azure%20after%20a%20demo%20and%20go%20home%20for%20the%20weekend.%20I%20then%20remember%20the%20following%20week%20that%20the%20system%20has%20been%20running%20all%20this%20time%20and%20not%20being%20used!%26nbsp%3B%20Keep%20that%20from%20happening%20by%20setting%20up%20Auto-Shutdown.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F160191i40A326948E69FBF1%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%22clipboard_image_3.png%22%20title%3D%22clipboard_image_3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20have%20configured%20auto-shutdown%20at%207PM%20Pacific%20time%20and%20I%20have%20it%20to%20sending%20a%20webhook%20to%20one%20of%20my%20Microsoft%20Teams%20channels%20as%20well%20as%20send%20me%20an%20email%20that%20it%E2%80%99s%20about%20to%20shut%20down.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F160192iA632DED528A92138%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_4.png%22%20title%3D%22clipboard_image_4.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20want%20to%20know%20how%20to%20configure%20Microsoft%20Teams%20to%20receive%20this%20WebHook%20(it%E2%80%99s%20on%20a%20per-channel%20basis)%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fmicrosoftteams%2Fplatform%2Fwebhooks-and-connectors%2Fhow-to%2Fadd-incoming-webhook%3FWT.mc_id%3Ditopstalk-blog-rclaus%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Echeck%20out%20this%20article%3C%2FA%3E%20about%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20box%20has%20served%20me%20well%20and%20for%20the%20most%20part%20has%20been%20inexpensive%20for%20me%20to%20run.%20It%20gets%20about%205-10%20hrs%20of%20use%20on%20days%20when%20it%20is%20required%20%E2%80%93%20and%20besides%20minimal%20storage%20costs%20%E2%80%93%20I%20am%20only%20charged%20for%20VM%20running%20time.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENot%20a%20bad%20little%20solution%20to%20replace%20that%20land-locked%20Hyper-V%20Home%20server%20when%20you%20need%20something%20in%20a%20pinch%2C%20eh%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1048762%22%20slang%3D%22en-US%22%3E%3CP%3EI%20needed%20a%20good%20old%20fashioned%20%22Hyper-V%20Lab%22%20system%20to%20build%20some%20demos%20recently%20and%20i%20didn't%20have%20any%20spare%20hardware.%20I%20needed%20reliable%20CheckPoints%20for%20demo%20creation%20and%20i%20needed%20to%20access%20it%20remotely.%20I%20said%20to%20myself%20-%20can%20I%20just%20build%20this%20big%20Hyper-V%20Lab%20system%20in%20Azure%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1048762%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ERick%20Claus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20Server%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

I was recently challenged with having to create technical demos for a Microsoft Ignite the tour session called “Migrating to Windows Server 2019(watch the recording here - awesome session). The demos for this talk centered around taking a bunch of Windows Server 2008 R2 systems running “core infrastructure services” (Active Directory, DHCP and File Servers) and moving those workloads over to systems running Windows Server 2019. This was simulating an on-prem environment that was going through a modernization process.  I’ve been making technical demos for a long time now – so it should have been easy to pull off. Fire up my Hyper-V lab server and make some VMs.  

 

Then it hit me. I no longer have a Hyper-V Lab server kicking around I can use as my demo platform. I had recycled my old home lab when I changed jobs close to 5 years ago to go work in Azure Compute. My daily driver laptop was a little anemic on the RAM side to run 6-8 VMs and I need to take snapshots / checkpoints at various points in the building process in order to test and optimize the demo flow. What’s an IT Pro to do?

 

clipboard_image_0.jpeg

 

If you check the lower left side of my laptop stickers – you’ll see a quote “my other computer is an Azure datacenter”. Why not harness this on demand power and only pay for what I use?  Let me share with you a recipe for what I built, how I securely access it and what I did to minimize costs.

 

Ingredients

  • Azure Subscription. Be forewarned: This will Hyper-V Host machine will NOT fit inside a trial subscription. You might need to request a quota increase (via for the machine type and core count for the region you choose.
  • Resource group: located in a region close to where you are. This will contain all the resources required for this setup and can be easily deleted if you so choose once complete.
  • Suitable VM Size that has enough cores, RAM and disk attach to match performance you need to host machines. Go check out Azure VM Sizes documentation for a complete list – I opted for a machine in the General Purpose Dsv3 Series machines for my box based on the estimated 64 Gig of ram (8 machines, 8 GB each) with at least 2 vCPU each (16 cores) just for the VM load – plus the needed headroom for the host box.

Note: this has to be one of the hyperthreaded “v3” machine sizes in order to do paravirtualization. 

  • A set of ISO files for Windows Server 2008R2 and Windows Server 2019.

 

Step-By-Step:

  • To keep this simple – I created a VM with the interactive Azure Portal experience. You can follow the basic steps by using the “Create a Windows VM in the Azure Portal” document – with the following CHANGES.
    • Create your own unique Resource Group name and choose a convenient location
    • Change the SIZE of the vm to meet your performance needs. I chose a Standard D64s v3 (64 vcpus, 256 GiB memory)
    • Choose your own Administrator account and password.
    • DO NOT configure any inbound networking ports at this time
    • On the Disk page, I created and attached a new managed disk of 1 TB in size based on premium SSD.
  • Once provisioned and running – in the Azure portal I went to the overview page of the VM and clicked on the Connect button.

 

clipboard_image_1.png

 

  • Remember – there are NO open ports to the internet because I asked for none to be opened when the VM was created. To make accessing this VM more secure I am going to enable Just-In-Time by clicking on the hyperlink above and clicking the button to enable it.
  • Once enabled – the default policy is for port 3389 (RDP access) to be opened to a restricted IP address and only remain open for 3 hrs.

 

clipboard_image_2.png

 

  • Click on the Request Access button, once granted, download the RDP file, open it and logon to the remote Azure based VM with the credentials you specified during VM creation.

NOTE: I am using RDP with JIT because I will be copying files between my workstation at work/home into the VM in Azure using the RDP client.

 

  • Once logged on to my remote “Hyper-V Lab Server” in Azure – I needed to enable the Hyper-V role and start doing some paravirtualization. From a PS prompt on the machine:
    • Install-WindowsFeature -name hyper-v,rsat-hyper-v-tools
  • Create a new Hyper-v switch for the demo environment
    • New-VMSwitch -switchname "NatSwitch" -SwitchType internal
  • Get the ifIndex value of the new switch called “NatSwitch” (make note of it – mine was 14)
    • Get-netadapter
  • Set a static IP address on the new Hyper-V Switch interface (use the ifIndex value for InterfaceIndex)
    • New-NetIPAddress -IPAddress 192.168.0.1 -prefixLength 24 -InterfaceIndex 14
  • Setup NAT for the hyper-v switch interface
    • New-NetNat -name MyDemoNAT -InternalIPInterfaceAddressPrefix 192.168.0.0/24

That basically does it.

 

You now have a box that does Hyper-V with Management tools installed. It is the appropriate size to handle quick demo workloads and since it’s Hyper-V, it supports multiple checkpoints! You made it more secure to access by enabling Just-In-Time (JIT) requests for remote VM connectivity. This JIT connectivity is audited and enabled for 3 hrs, after which time the JIT controlled Network Security Group allowing RDP access will be deleted. You have also created a new Hyper-V switch on which you can now create paravirtualized VMs with NAT connectivity to the internet in order to allow for Guest VMs download updates, tools and other things. Oh yeah – the internet speeds from a datacenter are WONDERFUL.  

 

Bonus Section: Save Money and prevent accidental VM billing

Trust me – I have been there. I forget to spin down a VM in Azure after a demo and go home for the weekend. I then remember the following week that the system has been running all this time and not being used!  Keep that from happening by setting up Auto-Shutdown.

 

clipboard_image_3.png

 

I have configured auto-shutdown at 7PM Pacific time and I have it to sending a webhook to one of my Microsoft Teams channels as well as send me an email that it’s about to shut down.

 

clipboard_image_4.png

 

If you want to know how to configure Microsoft Teams to receive this WebHook (it’s on a per-channel basis) check out this article about it.

 

This box has served me well and for the most part has been inexpensive for me to run. It gets about 5-10 hrs of use on days when it is required – and besides minimal storage costs – I am only charged for VM running time.

 

Not a bad little solution to replace that land-locked Hyper-V Home server when you need something in a pinch, eh?