search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Virtual Machine Manager, Windows Powershell | No Comment | 3,450 views | 11/04/2012 20:41

Merhaba,

Çözümpark üzerinden yayınladığım yeni sunumumda kullanacağım komutları ve slaytı aşağıda bulabilirsiniz.

ReFS üzerinde yeni sanal sunucu yaratma:

New-VM -Name Cozumpark01 -NewVHDSizeBytes 40Gb -NewVHDPath R:\Cozumpark01\System.vhdx -Path R:\

Yarattığımız bu sunucunun detaylı özelliklerini görme:

Get-VM Cozumpark01 | fl *

Sanal sunucunun isminde wildcard kullanabilirsiniz. Örneğin:

Get-VM Cozum*01 | fl *



Posted in Virtual Machine Manager, Windows Powershell | No Comment | 5,555 views | 19/03/2012 21:12

Hello,

Info: SetLinuxVM now supports Hyper-V v3 and SCVMM 2012 SP1 as well!

After number of bug fixes, improvements and new functionalities, Set-LinuxVM reached to version 3.1 stable.

Fixed bugs:
1) Integration services installation bug.
2) Synthetic network adapter issue
3) Wait-VMProcess improvements

New functionalities:
1) Windows Server 8 Beta support! You can use SetLinuxVM on Powershell v3.
2) Hyper-V v3 support! SetLinuxVM is now compatible with new Hyper-V wmi interface.
3) SCVMM 2012 SP1 support! SetLinuxVM recognizes SCVMM 2012 SP1 and uses it automatically.
4) New Restart-LinuxVM command for Linux VM reboot.

General functionalities:
1) Unattended IP, Hostname and DNS configuration for Linux VMs.
2) Automatic Linux integration components installation.
3) Multi Distro Support: Debian, Ubuntu, Centos, Fedora, Redhat, Suse and CloudLinux!
4) Automatic CPanel and Parallels Plesk installation.
5) Linux VM Template support
6) Hyper-V support! You don’t need SCVMM to use this script.
7) Multiple Hyper-V and SCVMM host support.
8) Automatic Emulated NIC to Synthetic NIC support.
9) No need to internet connection (SSH access etc.) or additional changes on VM.
10) Custom Answer File support! You can execute your own scripts.

Copyright (C) 2012 Yusuf Ozturk

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Download:

Donate: Thanks to support this open source project!





Usage:

1. First, you should allow signed Powershell scripts:

Set-ExecutionPolicy AllSigned

2. Extract file and move “SetLinuxVM” directory under to “C:\Windows\System32\WindowsPowerShell\v1.0\Modules”.

3. Import as a module:

Import-Module SetLinuxVM

4. That’s it. To see how to use it:

Get-help Set-LinuxVM -full

5. Follow to instructions.

You can search in my blog for how to create Linux VM templates!


Posted in Windows Powershell | 1 Comment | 5,198 views | 06/03/2012 22:21

In this post, I’ll talk about network operations on Windows Server 8 Beta. I have a virtual machine on my Hyper-V server with 4 virtual network adapter. They are all binded to same network, so I can set same ip addresses on them and I’m also able to make them teamed.

1. First of all, lets get network adapters.

Get-NetAdapter

I see all network adapters with some informations like name, description, ifindex and status.

2. I’ll get one of them and see full details.

Get-NetAdapter -Name "Wired Ethernet Connection"

Btw, you can also use wildcard (*) in your commands to make them easy.

Get-NetAdapter -Name "Wired*Connection

As you see, both of them works as we expected.



Posted in Windows Powershell | 1 Comment | 3,104 views | 05/03/2012 02:16

You may not use Microsoft WebMatrix 2 Beta if your region format is not English. In that case you will probably see “index was outside the bounds of the array” when you try to edit files. I wrote a quick workaround in Powershell to solve this problem.

1
2
3
4
Set-ItemProperty -Path "Registry::HKEY_CURRENT_USER\Control Panel\International" -Name LocaleName -Value en-GB
& ${Env:ProgramFiles(x86)}"\Microsoft WebMatrix\WebMatrix.exe"
Start-Sleep 10
Set-ItemProperty -Path "Registry::HKEY_CURRENT_USER\Control Panel\International" -Name LocaleName -Value tr-TR

You should use this script to start WebMatrix 2 Beta. You can change shortcut path to execute this script as well.

Applied to: PowerShell v2, PowerShell v3


Posted in Windows Powershell, Windows Server | No Comment | 7,767 views | 05/03/2012 00:44

In this post, I’ll talk about disk operations on Windows Server 8 Beta. I have Windows 7 and Windows Server 8 Beta on a PC and I want to install Windows 8 Beta as well. I will resize my current Windows Server 8 partition and create a new partition for Windows 8 Beta. When I want to do this operation via Server Manager GUI (in case of you have Server 8 with GUI), I don’t see any option for “Shrink”. Maybe I’m looking to wrong section but here it is:

So lets do this operation via Powershell.

1. First of all lets get partition information.

Get-Partition

2. My drive letter is W. So I can get detailed information.

Get-Partition -DiskNumber 1 -PartitionNumber 2

3. Drive size is 373 Gb. I’ll resize it to 250 Gb.

Get-Partition -DiskNumber 1 -PartitionNumber 2 | Resize-Partition -Size 250GB



Posted in Windows Powershell | No Comment | 3,013 views | 17/02/2012 07:38

As you may know, I’ve recently published new version of SetLinuxVM. It’s currently in version 3. There are many great improvements but specificly I want to talk about Wait-VMReboot and Wait-VMProcess.

The biggest challenge in SetLinuxVM v2 was reboot process. There was a static time wait to cover reboot and service restart scenarios. But reboot and service restart duration may differ and depends on Distro, kernel and workloads on VM. If SetLinuxVM sends a command while Linux VM is rebooting, that command will probably fail. So SetLinuxVM should wait enough to Linux VM gets ready to login screen. But that wait has very big impact on provisioning duration.

So what SetLinuxVM v3 is doing? It does same thing as human eyes. Actually we are watching VM reboot process and if we see login screen, then we type our root username and password. So I did same process on SetLinuxVM. SetLinuxVM captures screen of Linux VM every 10 seconds and checks differences between two capture. So let’s give an example for this process.

1. I send a reboot signal to Linux VM.

2. I capture my first screenshot. VM is at the beginnnig of reboot process.

$State1 = (Watch-LinuxVM -VMName $VMName -VMHost $VMHost -VMCluster $VMCluster -VMMServer $VMMServer -WmiHost $WmiHost).ImageData

3. After 10 seconds, I capture another screenshot, almost at the end of procces.

$State2 = (Watch-LinuxVM -VMName $VMName -VMHost $VMHost -VMCluster $VMCluster -VMMServer $VMMServer -WmiHost $WmiHost).ImageData

4. If I check State1 and State2, Powershell tells me that they are not same. So after 10 seconds I capture another screenshot.

$State1 = (Watch-LinuxVM -VMName $VMName -VMHost $VMHost -VMCluster $VMCluster -VMMServer $VMMServer -WmiHost $WmiHost).ImageData

5. I capture a new screenshot after 10 seconds.

$State2 = (Watch-LinuxVM -VMName $VMName -VMHost $VMHost -VMCluster $VMCluster -VMMServer $VMMServer -WmiHost $WmiHost).ImageData

6. If I check State1 and State2, Powershell tells me that they are identical! So that means VM is finished reboot process or stucked in somewhere. Due to eliminate stucked situations, I do this verification twice. After second verification, if State1 and State2 is idential then SetLinuxVM says that VM is fully rebooted. But that’s just an assume. VM may be stucked forever in reboot process but there is nothing SetLinuxVM can do. You should fix that as a System Administrator.

You can use Wait-VMReboot like this:

Wait-VMReboot -VMName "CentOS01"

I hope you like it! Thanks for reading..


Posted in Windows Powershell | No Comment | 5,225 views | 14/02/2012 02:14

Hello,

Info: SetLinuxVM is now under GPLv2

After number of bug fixes, improvements and new functionalities, Set-LinuxVM reached version 3.0 stable.

Fixed bugs:
1) Suse Enterprise network script – path issue.
2) Debian LVM issue
3) Ubuntu network issue.
4) Suse Enterprise hostname issue.
5) CentOS hostname issue.
6) Suse Enterprise mandatory networks issue.
7) Dismount Linux IC issue
8) Determining reboot and service restarts
9) Ubuntu log off issue

New functionalities:
1) “Distro” is not a requirement. You don’t need to provide Distro name of Linux VM anymore! SetLinuxVM can detects Linux distro and execute commands specificly for that distro. But I still suggest you to use “Distro” to decrease provisioning duration.
2) “Network connectivity” is not a requirement. In previous versions, you need network connectivity inside the VM to install LIC. Now SetLinuxVM v3 uses Hyper-V LIC v3.2 ISO for LIC installation. We just mount ISO to VM and ready to go..
3) Secondary IP Support! Now you can add multiple Ip addresses to your Linux VM.
4) Backing-up VM Config! In previous versions, SetLinuxVM was removing config files to set new config files. Now SetLinuxVM v3 simply creates a backup directory in /home and moves all old config files in it by adding .bak extension. So if you do something wrong, just use backups of the config!
5) New Artificial Intelligence (AI) for SetLinuxVM: Wait-VMReboot and Wait-VMProcess. Now, SetLinuxVM understands virtual machine reboot process. In previous version, we were using static start-sleep durations to wait enough for reboot process completion. But now, we don’t use any static durations to continue VM provisioning! SetLinuxVM watch VM activies and decide if VM is finished rebooting.
6) Seperated provisioning support! In previous versions; hostname and ip-network information are required. Now with SetLinuxVM v3, you can just change hostname or extend LVM.
7) No static values in SetLinuxVM anymore! SetLinuxVM just reads Linux configuration and execute commands with that.
8) Secured with Code Signing Certificate from GlobalSign.
9) Console simulation for Linux VMs called Open-VMConsole. Now you can copy/past into Linux VMs by using Open-VMConsole. It simulates Linux console and lets you copy/past your commands.
10) Hyper-V CLuster support! Now we use Failover Cluster module to search VMs in Cluster nodes. This is one of the best feature if you don’t use SCVMM.

Removed Functionalities:
1) Automatic updates for SetLinuxVM. I thought that may not be safe for customized scripts.
2) Hyper-V LIC v2.1 support! SetLinuxVM v3 only supports Hyper-V LIC v3.2. But SetLinuxVM is still able to provision Redhat/CentOS 5 even with LIC v2.1.
3) Debian and Ubuntu integration solutions due to performans and stability problems.

General functionalities:
1) Unattended IP, Hostname and DNS configuration for Linux VMs.
2) Automatic Linux integration components installation.
3) Multi Distro Support: Debian, Ubuntu, Centos, Fedora, Redhat, Suse and CloudLinux!
4) Automatic CPanel and Parallels Plesk installation.
5) Linux VM Template support
6) Hyper-V support! You don’t need SCVMM to use this script.
7) Multiple Hyper-V and SCVMM host support.
8) Automatic Emulated NIC to Synthetic NIC support.
9) No need to internet connection (SSH access etc.) or additional changes on VM.
10) Custom Answer File support! You can execute your own scripts.

Copyright (C) 2012 Yusuf Ozturk

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Download:

Donate: Thanks to support this open source project!





Usage:

1. First, you should allow signed Powershell scripts:

Set-ExecutionPolicy AllSigned

2. Extract file and move “SetLinuxVM” directory under to “C:\Windows\System32\WindowsPowerShell\v1.0\Modules”.

3. Import as a module:

Import-Module SetLinuxVM

4. That’s it. To see how to use it:

Get-help Set-LinuxVM -full

5. Follow to instructions.

You can search in my blog for how to create Linux VM templates!