Posted in Virtual Machine Manager, Windows Powershell | 10 Comments | 3,261 views | 04/04/2013 20:25
Hi guys and ladies! :)
Update: v1.4 is here! Thanks for your feedbacks.
Hyper-V VM Migration Script is ready! Now it’s possible to migrate your VMs from Hyper-V v2 to Hyper-V v3 with quick migration capabilities.
It supports following scenarios:
1. Standalone Hyper-V v2 Host
So why it supports untrusted domains? Because you may not want to install Windows Server 2012 Cluster into your existing Windows Server 2008 R2 environment. If you have totally different environment for Hyper-V v3, then this script is your best friend.
1. It supports BITS! It’s ready to move large VHD files.
How to Install?
2. You can use exe or msi file to installation. I’ve just used migration.exe file to installation.
3. Change Powershell path if you have different drive path.
4. Click Install to begin installation.
5. That’s it! You can start using migration script.
6. Go to Powershell and type following to change execution policy as “AllSigned”.
7. Allow my code publishing certificate. This will prevent you to run untrusted scripts.
8. Installation is done! Now we can start migration of virtual machines.
How to use?
Example 1: If want to migrate VM01 from HV001 (10.10.10.2) to your local Hyper-V v3 host, use following:
BTW, -VMPath switch is the destination path. Not your current VM path. This script finds VM path automatically.
Example 2: If HV001 (10.10.10.2) is a standalone machine, use following:
Example 3: If HV001 (10.10.10.2) is a member of a untrusted domain, use following:
Example 4: Having trouble with migration? Use debugging switch (-DebugMode) to see what really makes that problem:
1. You should install this script on to your Hyper-V v3 host.
2. This script doesn’t allow you to migrate VMs if they have snapshots. You should remove them first.
3. Requires Powershell v3. (It comes by default on Windows Server 2012)
4. Hyper-V v2 host and Hyper-V v3 host should have same network switch names. If they are different, this script connects first external network to your virtual machine.
Thanks for using Hyper-V VM Migration script!
Posted in Virtual Machine Manager | No Comment | 1,338 views | 07/01/2013 21:34
I specified SQL Server 2012 Always On Group name as a database server while SCVMM 2012 SP1 installation.
SCVMM creates databases with “Simple” recovery model. You should make it “Full” before adding it to Always-On Group.
Take a full backup of SCVMM database.
Now you can add it to Always-On Group.
Our SCVMM database is now in Always-On Group.
Then I made a failover test to see how SCVMM is reacting..
But boom! SCVMM GUI is crashed! I checked service and saw that service is stopped.
I’ve tried to restart SCVMM service but it gave me error:
Because SCVMM creates “Computer Account” only on primary SQL Server.
You should create same user on your failover SQL Server. After that you will be able to start SCVMM service.
Then I tried a failover test again and no problem! SCVMM works without any problem :)
Posted in Virtual Machine Manager, Windows Powershell | No Comment | 2,847 views | 12/10/2012 11:55
1. How to create RunAs Account?
2. How to get RunAs Account?
3. How to remove RunAs Account?
Posted in Virtual Machine Manager, Windows Powershell | No Comment | 2,449 views | 10/10/2012 14:25
Somehow, you have to migrate a new Hyper-V v3 VM back to Hyper-V v2 environment?
Of course if you need to migrate a VM from Hyper-V v2 to Hyper-V v3, you can use this script for quick migration:
If you export a virtual machine from Hyper-V v3 and try to import Hyper-V v2, Hyper-V gives this error:
Because Hyper-V v3 export is not compatible with old version of Hyper-V.
Achieve this problem, you need to use this Powershell export script on Hyper-V v3.
Before exporting virtual machine, do following steps:
1. Remove your all disks file from virtual machines.
Thanks to Ben, this script exports VM config in Hyper-V v2 style.
Now download EXP template from here:
Open your exported .exp file and template.exp file in the zip file with a text editor.
You will see $Replace1, $Replace2, $Replace3 and $Replace4 in template.exp.
Follow these steps for modification:
1. Replace this one with your virtual machine GUID: $Replace1
2. Replace this one with your virtual machine name: $Replace2
3. Replace this one with your virtual machine MAC address: $Replace3
4. Replace this one with your virtual machine ethernet port GUID: $Replace4
5. Finally, replace template.exp file name with your exported .exp file name.
Now you can import it to Hyper-V v2. After import, you can attach your virtual disks to VM again.
Posted in Virtual Machine Manager, Windows Powershell, Windows Server | No Comment | 829 views | 29/09/2012 07:56
SetLinuxVM v5 is out! It’s the best Linux VM preparation solution for Hyper-V on the market. But what’s changed with SetLinuxVM v5 and how it’s become fastest solution on the market?
1. Executing scripts instead of sending codes
In previous versions of SetLinuxVM, the idea was sending commands to virtual machine via Wmi interface. It was a great idea and nicely worked for 4 great versions of SetLinuxVM. But it took more than 5 minutes for a full preparation and it was a long time. So I made scripts and executing script is just easy and error-free.
Lets see old style of wmi code:
Now I just use that way to execute scripts:
Also now it’s easier to change scripts as your way. Sample timezone configuration script:
If you are familiar with Linux Bash scripting, it is very easy to modify these codes for your requirements.
2. Linux Integration Components 3.4
With new Linux integration components, SetLinuxVM is now able to install LIC on CentOS/RHEL 5 and CentOS/RHEL 6.
This gives the distro name. I use if/else statement to install it on your distro.
I talked about technical details of SetLinuxVM v5. I hope you enjoyed it. Thanks for using SetLinuxVM!
Posted in Virtual Machine Manager, Windows Server | No Comment | 1,172 views | 15/09/2012 21:45
Hyper-V üzerinde çalışan Linux sanal makineler için olan Linux Integration Services’in 3.4 versiyonu yayınlandı. Yeni sürüm ile birlikte artık Linux sanal sunucularda 4 vCPU’dan fazla vCPU kullanabilmek mümkün hale geldi.
Artık Linux için bir limit bulunmuyor, sanal vCPU limitini artık Hyper-V limitleri belirliyor. Windows Server 2012 ve Hyper-V Server 2012 ile birlikte Linux sanal sunucularınıza 64 vCPU verebilirsiniz. Ayrıca bu sürüm ile birlikte mouse/fare kullanımına tam destek geliyor.
Linux Integration Services v3.4 ile desteklenen Linux dağıtımları:
Ayrıca IC ile elde edebileceğiniz diğer önemli destekler:
Bu sürüm ile hala gelmeyen özellikler:
Hyper-V Linux Integration Services v3.4′ü indirmek için bu linki kullanabilirsiniz.
Posted in Virtual Machine Manager, Windows Powershell, Windows Server | 1 Comment | 1,340 views | 25/08/2012 22:01
I’m re-coding PoSHStats for Cluster support. Currently it just supports standalone hosts, but i have to extend that support for cluster environments. So while i’m playing with Powershell, I want to add some of my codes.
Getting Hyper-V hostname:
Getting Cluster name of your Hyper-V host:
Even better one for Hyper-V specifically:
Also I see that this doesn’t work as expected on PowerShell v3, so don’t use something like this:
Getting all clustered virtual machines:
Also you can extend your query for resource monitoring:
Getting free space of Cluster Shared Volume:
Getting total disk space of Cluster Shared Volume:
I’ll share more next days, keep watching..