@bobnoordam

Category: Hyper-V

Enabling Powershell Hyper-V cmdlets on upgraded systems

One of the great things added with Server 2012 (and Windows 8) is full support for Hyper-V in powershell. There is a long list of cmdlets that make managing virtual machines a breeze. (see: this technet link ). If you upgraded a server from Server 2008/2008R2 to Server 2012 you will find the cmdlet’s oddly missing … The upgrade did install the new version of Hyper-V but did not add the powershell management library to […]

HYPER-V Back Script, with optional suspend or stop of the virtual machine

With the help of the powershell applets for HYPER-V it has become quite easy to create a reliable backup of your virtual machines without the need for highly expensive backup tools. The script uses the standard export functionality build into HYPER-V, so you can restore one of these backup’s to the actual virtual machine including the unique identifiers Adept the configuration section at the top of the script with the network locations of your choosing. […]

Exporting a HYPER-V Virtual machine to a network share

If you start a HYPER-V virtual machine export to a share, you will be greeted by an permissions error. This happens both with a manual export, and with a scripted backup through powershell using the Export-Vm cmdlet. note: this procedure does not apply to migrations The resolution for this problem is luckily simple. You need to give the source computer permissions on the target share and folder. That menas your steps are: Bring up the […]

Hyper-V 2008 Powershell Security Warnings

After setting the execution policy for windows powershell to unrestricted, you still are unable to run powershell scripts from a batch file or the command line without the following warning popping up: C:\MyScripts> Set-ExecutionPolicy unrestricted PS C:\MyScripts> ./somefile.ps1 Security Warning Run only scripts that you trust. While scripts from the Internet can be usefull they can also be used to damage your computer. Do you want to run C:\MyScripts\somefile.ps1? [D] Do not run [R] Run […]

Effective VHDX compacting with HYPER-V 2012 and networked storage

There are a lot of instructions out on the internet which lead you through some compacting routine, with varying success. This usually amounts to stopping the VM/VDI and running the disk edit function from the HYPER-V console. In many cases, and especially if you are using networked storage, you will find that most of the time the “compacted” size of the disk is an exact match of the size before compacting. Or in other words: […]

HYPER-V Compacting of ext4 disks

There are some claims around that quick wins may be made on ext4 disks by using fstrim to release unused blocks, by running #sudo fstrim , however, in practice this will give you fairly limited gains, or none at all. I believe the actual effect of trim is largely misunderstood, as it’s function is _not_ to zero out blocks (which is what you need for compacting) but just communicating which blocks the filesystem no longer […]