Home
%3CLINGO-SUB%20id%3D%22lingo-sub-749550%22%20slang%3D%22en-US%22%3EAzure%20Lab%20Services%20addition%20tips%20and%20tricks%20for%20customisation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749550%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20474px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123006i6E19E26168625825%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22lab%20services.jpg%22%20title%3D%22lab%20services.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%20wanted%20to%20share%20some%20additional%20tips%20and%20trick%20for%20getting%20the%20most%20out%20of%20Using%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fuk_faculty_connection%2F2018%2F05%2F11%2Fsetting-up-azure-classroom-labs-for-your-students-with-azure-lab-services%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Azure%20Lab%20Services%3C%2FA%3Ewithin%20your%20labs%20and%20classes%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%20948px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F123007iA19B5F255E7E4726%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22LabServ.png%22%20title%3D%22LabServ.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EOne%20of%20the%20main%20requirement%20most%20institutions%20have%20for%20the%20provision%20of%20lab%20resoruces%20is%20the%26nbsp%3Bability%20for%20educators%20and%20students%20to%20log%20into%20lab%20VMs%20using%20our%20AAD%20credentials%2C%20rather%20than%20using%20VM-local%20accounts.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20present%20the%20solution%20to%20AAD%20support%20to%20your%20Azure%20Lab%20images%20is%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20workaround%20that%20has%20been%20used%20in%20some%20Universities%20is%20to%20create%20a%20custom%20image%20that%2C%20at%20startup%2C%20performs%20the%20following%20steps%20through%20PS1%20scripts%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Join%20the%20VM%20to%20the%20AAD%20domain%3C%2FP%3E%0A%3CP%3E%26nbsp%3B2.%20Add%20the%20appropriate%20AAD%20Users%20(aka%20students%20for%20the%20course)%20to%20the%20VM%2C%20so%20that%20they%20can%20log%20into%20it%20using%20their%20AAD%20credentials%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20present%20adding%20machines%20to%20AAD%20via%20Powershell%20isnt%20available%20see%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ffeedback.azure.com%2Fforums%2F169401-azure-active-directory%2Fsuggestions%2F20399941-all-powershell-bash-script-azure-ad-join%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ffeedback.azure.com%2Fforums%2F169401-azure-active-directory%2Fsuggestions%2F20399941-all-powershell-bash-script-azure-ad-join%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3ESo%20the%20Lab%20Machine%20template%20will%20first%20need%20to%20be%20edited%20and%20then%20saved%20and%20then%20published%20or%20republished%20to%20all%20the%20users.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EJoining%20Windows%2010%20VM%20to%20a%20domain%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fdevices%2Fazuread-joined-devices-frx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory%2Fdevices%2Fazuread-joined-devices-frx%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EWindows%20Server%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory-domain-services%2Fjoin-windows-vm%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Factive-directory-domain-services%2Fjoin-windows-vm%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ELinux%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAdding%20the%20VM%20to%20AAD%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Flinux%2Flogin-using-aad%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Flinux%2Flogin-using-aad%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EAdding%20a%20user%20to%20the%20VM%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Flinux%2Fcloudinit-add-user%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Flinux%2Fcloudinit-add-user%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20Linked%20to%20the%20above%2C%20using%20our%20OneDrive%20storage%20as%20a%20preconfigured%20network%20volume%20on%20the%20VMs%20--%20this%20is%20our%20institution-preferred%20way%20for%20students%20to%20store%20files%20and%20we'd%20be%20keen%20to%20link%20it%20into%20our%20teaching%20for%20data%20that%20wasn't%20amenable%20to%20being%20put%20into%20github%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fonedrive%252Fuse-group-policy%2523OptInWithWizard%26amp%3Bdata%3D02%257C01%257Cleestott%2540microsoft.com%257C0f8d66116b8f4a64f18508d7042ce45f%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C636982463166691227%26amp%3Bsdata%3D0TVC4%252Bi63%252BsB%252BCn1vuJuiVfS4uI1FO3ObjxWvYRtYJY%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fonedrive%2Fuse-group-policy%23OptInWithWizard%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Ftechcommunity.microsoft.com%252Ft5%252FMicrosoft-OneDrive-Blog%252FMigrate-Your-Files-to-OneDrive-Easily-with-Known-Folder-Move%252Fba-p%252F207076%26amp%3Bdata%3D02%257C01%257Cleestott%2540microsoft.com%257C0f8d66116b8f4a64f18508d7042ce45f%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C636982463166701219%26amp%3Bsdata%3DzNK6eSYzez40%252F7q18B%252FV5covEV%252FPjkyIHfEZVBPByaM%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FMicrosoft-OneDrive-Blog%2FMigrate-Your-Files-to-OneDrive-Easily-with-Known-Folder-Move%2Fba-p%2F207076%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EWith%20the%20latest%20versions%20of%20OneDrive%20it%20is%20possible%20to%20configure%20the%20client%20at%20the%20machine%20level%20(rather%20than%20the%20user%20level)%3A%20%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttps%253A%252F%252Fdocs.microsoft.com%252Fen-us%252Fonedrive%252Fper-machine-installation%26amp%3Bdata%3D02%257C01%257Cleestott%2540microsoft.com%257C0f8d66116b8f4a64f18508d7042ce45f%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C636982463166711218%26amp%3Bsdata%3DtjYuHZ78D15Bvy%252F%252B5JW4WjsQ7DAHL6JhaPMwGzv5oJU%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fonedrive%2Fper-machine-installation%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20Being%20able%20to%20preserve%20storage%20on%20VMs%20for%20a%20longer-duration%20class%20that%20needs%20the%20underlying%20VM%20reconfigured.%20Ie%2C%20as%20a%20class%20progresses%2C%20moving%20from%20using%20lower-spec%20VMs%20to%20using%20GPU-enabled%20VMs%2C%20or%20moving%20between%20Linux%20and%20Windows%2C%20but%20preserving%20the%20equivalent%20of%20the%20user%20homespace%20in%20cloud%20storage.%20This%20could%20be%20the%20OneDrive%20solution%20above%2C%20but%20would%20be%20good%20to%20have%20a%20faster%2C%20more%20Azure-local%20storage%20solution%20if%20possible.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3E-%20We've%20had%20some%20problems%20logging%20in%20to%20linux%20lab%20instances%20with%20ssh%20from%20OS%20X%2C%20where%20we%20get%20control%20path%20length%20issues%20due%20to%20the%20length%20of%20the%20hostname.%20Some%20experimenting%20suggests%20that%20there%20is%20a%20total%20string%20length%20of%2083%20characters%20for%20port%20number%20plus%20%3CA%20href%3D%22mailto%3Auser%40host.domain%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Euser%40host.domain%3C%2FA%3E.%20With%20a%2075-character%20hostname.domainname%20and%20a%205%20character%20port%20number%20there's%20not%20much%20spare%20space%20%3A)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20How%20are%20incoming%20connection%20rules%20handled%2C%20and%20can%20we%20modify%20them%20to%20allow%20particular%20inbound%20ports%3F%20It%20looked%20like%20there's%20some%20inbound%20rewriting%20going%20somewhere%20on%20as%20the%20labs%20vm%20seemed%20to%20be%20listening%20on%20port%2022%20for%20ssh%2C%20which%20didn't%20correspond%20to%20our%20inbound%20port%20specified%20on%20the%20command%20line.%20Is%20there%20a%20possibility%20to%20allow%20extra%20inbound%20port%20exceptions%2Fforwarding%20other%20than%20ssh%20and%20rdp%20%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20Can%20we%20change%20the%20underlying%20'hardware'%20of%20the%20labs%20image%20whilst%20the%20lab%20is%20running%3F%20A%20particularly%20useful%20option%20would%20be%20to%20switch%20from%20a%20lower%20cost%20image%20for%20general%20use%20up%20to%20a%20GPU-enabled%20image%20for%20later%20ML%20classes.%20This%20is%20a%20'moderately%20useful'%20one%20for%20us%20which%20we%20could%20easily%20go%20either%20way%20on%20--%20on%20the%20one%20hand%20students%20like%20having%20longer-term%20home%20directory%20systems%2C%20on%20the%20other%20hand%20emphasising%20that%20work%20systems%20should%20be%20able%20to%20be%20low-cost-rebuilt%20out%20of%20backups%20and%20SCM%20is%20a%20good%20thing%20%3A)%3C%2Fimg%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20Is%20there%20a%20way%20to%20both%20have%20scheduled%20hours%20for%20classes%20and%20not%20have%20automatic%20shutdown%20of%20systems%20at%20the%20end%20of%20those%20hours%3F%20Having%20set%20hours%20each%20week%20which%20don't%20count%20against%20user%20quota%20sounds%20useful%2C%20but%20where%20students%20might%20be%20using%20their%20systems%20for%20additional%20work%20following%20on%20from%20the%20end%20of%20the%20classes%20it%20would%20be%20very%20useful%20not%20to%20have%20a%20mandated%20system%20shutdown.%20We%20can%20easily%20work%20around%20this%20by%20just%20adding%20the%20number%20of%20class%20hours%20as%20quota%2C%20but%20it%20would%20be%20nice%20if%20we%20could%20have%20some%20split%20between%20'core%20quota'%20and%20'extra%20hours'.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-%20Can%20we%20do%20anything%20to%20preserve%20user%20data%20over%20a%20template%20re-publish%3F%20I%20guess%20this%20comes%20under%20the%20'user%20data%20on%20network%20volume'%20discussed%20in%20previous%20mails%20with%20regard%20to%20using%20OneDrive%2C%20but%20before%20this%20is%20rolled%20out%20is%20there%20any%20option%20to%2C%20for%20example%2C%20have%20user%20home%20directories%20in%20cloud%20storage%3F%20This%20is%20another%20'moderately%20useful'%20one%20for%20us%20as%20we%20can%20template%20systems%20based%20on%20packaging%20rather%20than%20the%20published%20image%2C%20so%20apply%20rolling%20updates%20to%20the%20setup%20via%20package%20manager%20rather%20than%20the%20core%20lab%20template.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-749550%22%20slang%3D%22en-US%22%3E%3CP%3ETips%20and%20trick%20for%20getting%20the%20most%20out%20of%20Using%20%3CA%20href%3D%22https%3A%2F%2Fblogs.msdn.microsoft.com%2Fuk_faculty_connection%2F2018%2F05%2F11%2Fsetting-up-azure-classroom-labs-for-your-students-with-azure-lab-services%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft%20Azure%20Lab%20Services%3C%2FA%3Ewithin%20your%20labs%20and%20classes%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

lab services.jpg

I wanted to share some additional tips and trick for getting the most out of Using Microsoft Azure Lab Services within your labs and classes

 

LabServ.png

One of the main requirement most institutions have for the provision of lab resoruces is the ability for educators and students to log into lab VMs using our AAD credentials, rather than using VM-local accounts.

 

At present the solution to AAD support to your Azure Lab images is 

 

A workaround that has been used in some Universities is to create a custom image that, at startup, performs the following steps through PS1 scripts:

 

1. Join the VM to the AAD domain

 2. Add the appropriate AAD Users (aka students for the course) to the VM, so that they can log into it using their AAD credentials

 

At present adding machines to AAD via Powershell isnt available see https://feedback.azure.com/forums/169401-azure-active-directory/suggestions/20399941-all-powershell-... 


So the Lab Machine template will first need to be edited and then saved and then published or republished to all the users. 

 

Joining Windows 10 VM to a domain

https://docs.microsoft.com/en-us/azure/active-directory/devices/azuread-joined-devices-frx

 

Windows Server

https://docs.microsoft.com/en-us/azure/active-directory-domain-services/join-windows-vm

 

Linux

Adding the VM to AAD https://docs.microsoft.com/en-us/azure/virtual-machines/linux/login-using-aad

Adding a user to the VM https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cloudinit-add-user 

 

- Linked to the above, using our OneDrive storage as a preconfigured network volume on the VMs -- this is our institution-preferred way for students to store files and we'd be keen to link it into our teaching for data that wasn't amenable to being put into github

With the latest versions of OneDrive it is possible to configure the client at the machine level (rather than the user level): https://docs.microsoft.com/en-us/onedrive/per-machine-installation

 

- Being able to preserve storage on VMs for a longer-duration class that needs the underlying VM reconfigured. Ie, as a class progresses, moving from using lower-spec VMs to using GPU-enabled VMs, or moving between Linux and Windows, but preserving the equivalent of the user homespace in cloud storage. This could be the OneDrive solution above, but would be good to have a faster, more Azure-local storage solution if possible.

- We've had some problems logging in to linux lab instances with ssh from OS X, where we get control path length issues due to the length of the hostname. Some experimenting suggests that there is a total string length of 83 characters for port number plus user@host.domain. With a 75-character hostname.domainname and a 5 character port number there's not much spare space :)

 

- How are incoming connection rules handled, and can we modify them to allow particular inbound ports? It looked like there's some inbound rewriting going somewhere on as the labs vm seemed to be listening on port 22 for ssh, which didn't correspond to our inbound port specified on the command line. Is there a possibility to allow extra inbound port exceptions/forwarding other than ssh and rdp ?

 

- Can we change the underlying 'hardware' of the labs image whilst the lab is running? A particularly useful option would be to switch from a lower cost image for general use up to a GPU-enabled image for later ML classes. This is a 'moderately useful' one for us which we could easily go either way on -- on the one hand students like having longer-term home directory systems, on the other hand emphasising that work systems should be able to be low-cost-rebuilt out of backups and SCM is a good thing :)

 

- Is there a way to both have scheduled hours for classes and not have automatic shutdown of systems at the end of those hours? Having set hours each week which don't count against user quota sounds useful, but where students might be using their systems for additional work following on from the end of the classes it would be very useful not to have a mandated system shutdown. We can easily work around this by just adding the number of class hours as quota, but it would be nice if we could have some split between 'core quota' and 'extra hours'.

 

- Can we do anything to preserve user data over a template re-publish? I guess this comes under the 'user data on network volume' discussed in previous mails with regard to using OneDrive, but before this is rolled out is there any option to, for example, have user home directories in cloud storage? This is another 'moderately useful' one for us as we can template systems based on packaging rather than the published image, so apply rolling updates to the setup via package manager rather than the core lab template.