Unidesk 2.x Layer Compression Utility
9 replies, 412 views
Posted on October 20, 2016
Edited by Unidesk employee Rob Zylowski 3 weeks ago
Rob Zylowski
Unidesk employee
Joined: June 21, 2010

After upgrading my Windows 10 OS layer from 1511 to 1607 I noticed the size of my OS Layer became 38GB.  I decided to finally figure out how to compress layers by zero out deleted blocks in the VM then using vmkfstools to punch the blocks out of the vmdk.  The resulting layer was only 15 GB.

I then wrote a blog (to be released soon) describing how to do it.

My boss then challenged mne to develop automation around the process so I created this utility whcih allows you to compress every layer you arte about to finalize.  Most layers only shrink a little in soze maybe a third of the layer but it does allow you to keep layers as small as possible.

This is the first version of this utility.  I have tested it but no one else has.  Please test any layers you create prior to rolling them out to real users.

Here is the documentation

 

Here is the utility

Update Ver 1.1 10-31-2016

Shane found a bug in the MA test scripting.

Update ver 1.2 11-2-2016

Another small bug fix plus i added to the documentation that you must enable ssh on the host and allow ssh through the firewall.

Update ver 1.3 11-6-2016

Thanks to help from several csutomers I fixed a bug when using edit latest version which would show some strane results when you retirieved the running install machines.  I also changed how i look for the attached disk on teh console machine to check the disk label to make sure it matches the disk we attached.  Lastly i leave open the powershell window in case you want to review any errors.  But rmember errors woud eb listed in the log file as well.

Update 1.31 11-8-2016

I small change i thought i had made already.  If you have set this up you just need to update the compress.ps1 file.

Update 2.0 12-9-2016

Some user had issues wiht the way to utility determined which disk on the console machine to process.  I reworked the logic for that so it would work universally.

Update 2.1 12-16-2016

My last update was not sufficient to fix the issue where the filenames didnt match from our database to the layer.  This version now chooses the last disk attached to the Install Machine as the disk to modify.  This seems to always work.

Update 12-28-2016

I added the ability to compress UEP disks for persistent desktops.  Please read the documentaiotn carefully and test first on desktops of non-real users.  I have tested wiht OK resutls.  I saved about 1-2 GB per desktop for UEP disks.

As always after you download the zip edit the properties and unblock the zip before extracting it.

Let me know how it works for you if you try it.

Rob

 

Posted on October 28, 2016
Edited by connerrs on October 28, 2016
connerrs
Registered user
Joined: February 4, 2016

Hey Rob,

I'm trying to test this out but keep getting an error when saving the MA administrator account/password. The same username and password work on the console itself and the other utilities, like the Backup utility, so I don't believe it's an issue with the credentials. Any tips?

When I click "Save MA Info" I get the following:

Saving MA Account and Password information
Encrypting and Saving the MA root password
Encrypting and Saving the MA Administrator password
Initializing the MA for use with plink
The MA was successfully initilized for use with plink
Testing the MA Root Password
The MA Root Password successfully passed the logon test
Testing the Administrator Account
The MA administrator account/password logon test failed
Please enter the administrator account/password again and retry the save
Changes were not all saved
Posted on October 28, 2016
Edited by Unidesk employee Rob Zylowski on October 28, 2016
Rob Zylowski
Unidesk employee
Joined: June 21, 2010

Hi Conner,

When you donwloaded the zip did you unblock it before extracting the contents.  It could be that all the scripts are blocked.  To see go into the powershell folder and look at the properties of the scripts.  See if they are blocked and if they are unblock them.  It not let me know and i will review the code.

Rob

Posted on October 31, 2016
connerrs
Registered user
Joined: February 4, 2016

Hi Rob,

I've confirmed that the files are unblocked. Please let me know if there's anything else I can/should try on my end. Thanks

Posted on November 3, 2016
Jeremy Ey
Registered user
Joined: May 22, 2012

Rob,

Is there a way to have the console window that opens during the Compress operation stay open? I'm getting an error there, but haven't been able to capture it.

The log correctly lists my install machine, the utility VM, but for the disk logs: "Disk to process wll be []" it then ends with "Unable to attach VMDK to console machine - ExitingScript"

Thanks,

Jeremy Ey

Posted on November 3, 2016
Rob Zylowski
Unidesk employee
Joined: June 21, 2010

Hi Jeremy,

After you try to run it it should save all the settingings in a config file called layerinfo.txt.  If that is there you can edit the compress.ps1 file "As Administrator" then run that in the powershell IDE and see what happens.

Lety me know if you need me to jump on a zoom wiht you to troubleshoot.

Rob

Posted on December 11, 2016
Edited by geriksen on December 11, 2016
geriksen
Registered user
Joined: January 4, 2011

Hi Rob,

Seems like the Storage Module are missing in Windows 7 32bit. I tried to get your tool working from a Unidesk VM, but without any luck. Also installed Powershell v5, but still no Storage Module here. Seems like this is only supported for Windows 2012... So can this be fixed to support Windows 7?

Posted on December 16, 2016
Rob Zylowski
Unidesk employee
Joined: June 21, 2010

Sorry Glenn I am just seeing this.

I have not tested on Win 7 but the storage cmdlets come from VMware's PowerCLI.  Did you install PowerCli ? 

You need at least version 5.5 update 2 and Not 6.5 as I have not made it work wiht 6.5 yet and they changes deom a snapin to a module.

Rob

Posted 3 weeks ago
Rob Zylowski
Unidesk employee
Joined: June 21, 2010

For the latest version I included support for PowerCLI 6.5

Posted 1 day ago
Mark Worthington
Registered user
Joined: November 10, 2014

We are working on this.  Cause our base images are way to large and we have invested a lot in building the OS layers and Application layers.  So we really don't want to start all over.  When we went through the setup process and ran it, the VM just immediately shut down.  Is this supposed to happen?

Login to post comments