Archive

Archive for the ‘VMware’ Category

Using MVMC 2.0 to migrate a VMware VM to Azure IaaS

April 8th, 2014 No comments

This evening (in my timezone) Microsoft released the new version of the Microsoft Virtual Machine Converter 2.0 that has the functionality to also migrate VM´s to Azure in the wizard. I wanted to take that path for a spinn to test and see how that worked.

There are still some things to think about when using the tool,

  • it still uses ovf export
  • the VM in VMware is offline during the copy of the vmdk data (it creates a VHD for Azure, but if you choose a Hyper-V host you can set it to create a VHDX instead), this can with large amounts of data take some time and will consume space on the converter server.
  • The VM´s Windows OS has to be joined in a Active Directory domain, and the account being used has administrative rights in the VM to successfully uninstall VMware tools during conversion.
  • No EFI support, meaning that the VM´s in your vSphere has to be setup with BIOS to be able to convert (Windows 2012 and later is from a best practice in VMware configured with EFI), but UEFI support is only on VM´s i generation 2 and Azure does not have that, at least not yet..
  • Notice also that now with version 2.0 there is no support for migrating those Win 2003 VM´s

So how does it work in a migration from a VMware VM to Azure, well first of all in the wizard I select to migrate to Azure

Screen Shot 2014-04-08 at 22.10.53

Then I will add some information for the connection to my Azure subscription (yes I have done some editing in the image so not the whole world reading my blog would se my cert thumbprint and sub id)

Screen Shot 2014-04-08 at 22.11.02

After that I select what storage account I want the VHD to be transferred to (smart to think twice to select the storage account in the region where you have the network configured if you are using site 2 site vpn and such :-P ).

Screen Shot 2014-04-08 at 22.11.50

Then I connect to either vCenter or an ESXi and select what VM I want to convert

Screen Shot 2014-04-08 at 22.12.40

After that I either use the already entered credentials or other and the state of the source VM for a successful VMware tools uninstall and as it is being migrated to Azure I do not get the option to select state of the destination VM (that can of course if used with the Azure PowerShell module and MVMC module be automated)

Screen Shot 2014-04-08 at 22.15.28

For the MVMC to succeed in its task to move the VM to Azure it has to store the VHD somewhere before moving it up to the cloud, the little caveat here is that it will create a fixed size vhd so bare that in mind when selecting the drive so you have space!

Screen Shot 2014-04-08 at 22.15.36

Then it´s time to kickoff the conversion

Screen Shot 2014-04-08 at 22.15.50

And as you can see in my vCenter the conversion is under its way

Screen Shot 2014-04-08 at 22.24.21

And then after some waiting the conversion and the upload to azure has completed,

Screen Shot 2014-04-08 at 23.10.40

Now I can enter the Azure management portal and create a VM and from the gallery select this disk disk_testmigrate_00_os.vhd , as the MVMC creates a disk pointer from the storage blob (the VHD) I do not need to do that part.

Screen Shot 2014-04-08 at 23.28.34

And then I can connect to the VM

Screen Shot 2014-04-08 at 23.36.13

Apparently I had some issues creating the VM as a Basic but using standard it worked nicely and as you can see I managed to get an RDP session to it.. So it was not lost in the cloud as in this Dilbert cartoon :-P

lostdatacenter

Categories: Azure, Virtualization, VMware Tags:

New version of the Microsoft Virtual Machine Converter 2.0 and MAT

April 8th, 2014 No comments

Today Microsoft released the long awaited new version of the Virtual Machine Converter (the 1.0 version could be integrated with MAT but had limits in both VMware and Hyper-V latest releases). Microsoft has also released a new version of the MAT (migration automation toolkit) that supports the MVMC 2.0 to automate the migration!

Screen Shot 2014-04-08 at 19.20.57

New Features in MVMC 2.0

MVMC 2.0 release of MVMC includes the following new features:

    • Converts virtual disks that are attached to a VMware virtual machine to virtual hard disks (VHDs) that can be uploaded to Windows Azure.
    • Provides native Windows PowerShell capability that enables scripting and integration into IT automation workflows.
      Note The command-line interface (CLI) in MVMC 1.0 has been replaced by Windows PowerShell in MVMC 2.0.
    • Supports conversion and provisioning of Linux-based guest operating systems from VMware hosts to Hyper-V hosts.
    • Supports conversion of offline virtual machines.
    • Supports the new virtual hard disk format (VHDX) when converting and provisioning in Hyper-V in Windows Server® 2012 R2 and Windows Server 2012.
    • Supports conversion of virtual machines from VMware vSphere 5.5, VMware vSphere 5.1, and VMware vSphere 4.1 hosts Hyper-V virtual machines.
    • Supports Windows Server® 2012 R2, Windows Server® 2012, and Windows® 8 as guest operating systems that you can select for conversion

in the link you can read more about the MVMC functionality

As you can see in the wizard the option to upload the converted VM to Azure directly has been added

Screen Shot 2014-04-08 at 19.21.50

And now in this version we have native PowerShell with the MVMC PS module as described above:

Screen Shot 2014-04-08 at 20.05.11

I will show more in a later post how it can be used and how it works with both migrations to Hyper-V and also directly to Azure :-)

both MVMC and MAT can be read about and downloaded here

Categories: Azure, Hyper-V, Powershell, Virtualization, VMware Tags:

New book about PowerCLI have been released!

March 5th, 2014 No comments

I have had the pleasure to find a new book about PowerCLI that have been released.

Learning PowerCLI by Robert van den Nieuwendijk

Screen Shot 2014-03-05 at 21.20.24

 

The book has 10 chapters and is truly a bible for a VMware Admin that wants to learn how to utilize PowerCLI in their environment. The book covers the latest version of PowerCLI and PowerShell v3.

If you are new to PowerShell and PowerCLI the first chapters gives you great guidance in how to do basic things and once you feel comfortable you can continue with the other chapters and start automating your daunting tasks as a VI Admin!

I have done some magic with PowerCLI and I can recommend you to add it to your shelf to be comfortable in your career :-)

If you are interested in getting more info on the book please follow this link  http://www.packtpub.com/learning-powercli/book

 

Categories: PowerCLI, Virtualization, VMware Tags:

Finally the MAT4Move has been released, but where to find it?

February 3rd, 2014 No comments

Now I found the release of the Migration Automation Toolkit for Double-Take Move. As I described in an earlier post I was waiting for this and now it was released.

It is as described in the readme, a technology preview and for users with PowerShell skills.

Screen Shot 2014-02-03 at 16.58.05

And it has not yet appeared on the Gallery but you can find it on the Vision Solutions Support site (where you will need an account to login), and on the Move download page you see it on the top :-)

Screen Shot 2014-02-03 at 16.44.46

 I will write a more thorough article about how the experience to use it compared to the Vision Solutions Double-Take System Center toolkit in a later blog post!

Categories: Hyper-V, Virtualization, VMware Tags:

Nordic System Center Summit – Migrate to Hyper-V

December 6th, 2013 No comments

logo

The last two days I was on the road and presented my session on migrate to Hyper-V and that on the Nordic System Center Summit that was hosted by my company Lumagate. We visited both Stockholm and Oslo.

Both Travis Wright and Chris Ross from Cireson was with us and had some really interesting sessions!

In my presentation I described the different ways to migrate and how to prepare for a large migration and that in different ways of automation.

Here is the presentation:

Migrate-TO-HyperV

And if you have a PC/MAC you can view the presentation directly here with PowerPoint Webapp

Categories: Automation, Hyper-V, SCVMM, Virtualization, VMware Tags:

VMware to Hyper-V Migration with Netapp shift and MAT

November 4th, 2013 No comments

I have been doing some seminars and presentations on the subject of migration from VMware. My latest seminars was with my colleague Kristian Nese and we were in Stockholm, Oslo and Trondheim talking about the cloud os, the new features in Hyper-V 2012 R2 and System Center VMM 2012 R2 and also migration and the different tools. After the summer camp at Microsoft I did a blog post about my customisations of the MAT that was running with MVMC and my way to solve the IP addresses and after my blog post there have come an updated version of the MAT that do handle the NIC.

If you plan to do a migration and just happens to be one of the lucky guys that have a Netapp box with Data ONTAP 8.2 in Cluster Mode in your VMware environment you can use the MAT for shift that can be found on the gallery. It utilizes the NetApp Data ONTAP PowerShell toolkit and the features in the Netapp storage that converts the vmdk files to vhdx right in the storage and boy do that save migration time as you do not have to move loads of data for your large VM´s over the network and then convert them at the target. As the Netapp software is so intelligent it does not write over the old data and you can quite easily go back if you find any issues after the migration.

Building Clouds have a blog post and Migration Mark has done a funny movie that can be watched on Youtube that explains the procedure and how fast it is!

Hope to start a project really soon with a Netapp customer :-)

Categories: Hyper-V, Virtualization, VMware Tags:

VMware to Hyper-V Migration with MAT and my addons

August 15th, 2013 2 comments

Today I was on Sommarkollo at Microsoft Sweden and speaking on the event and this was the last of two sessions about the MAT (Migration Automation Toolkit).

This automation tool that I first got to know about at MMS 2013 in Las Vegas (sadly it looks like there will be no more MMS :-( but that is another story ) in the session held by “Migration Mark” and Matt McSpirit WS-B325 and there in the video about 41 minutes into I ask about how the MAT take care of IP addresses on the migrated VM´s and they answered me that is not part of the MAT yet! And well I would say that this would be quite painful to migrate 100-200 VM´s with this automation tool and still have to enter IP settings for each migrated vm manually!!

But I have an example on how that can be done, I have not integrated it into the MAT scripts yet but it automates the collection of not just the IP addresses but also dns,subnet and gateway.

The information is available via the PowerCLI from the vCenter and here I show you how you can collect all that info after you have got the migration list

# Collect Networking info from VM´s 
#
# Niklas Akerlund / 2013-07-01
if(!(Get-PSSnapin "VMware.VimAutomation.Core" -ErrorAction SilentlyContinue)){
    Add-PSSnapin "VMware.VimAutomation.Core"
}
$MigVMs = Get-Content "d:\mat\vmlist.txt"
$VMNetConf = @()
Connect-VIServer vCenter.vniklas.com
remove-module Hyper-V -ErrorAction SilentlyContinue

foreach ($MigVM in $MigVMs){
     $VM = Get-VM $MigVM.Split(".")[0]
     #write-host $VM
     #$VM = Get-VM $VM 
     $VMNics = Get-VMGuestNetworkInterface $VM | where {$_.IP -ne $null -and $_.IPPolicy -eq "Static"}
     foreach ($VMNic in $VMNics){
         $VMNetAdapter = Get-NetworkAdapter -VM $VMNic.VM -Name $VMNic.NetworkAdapter
          $obj = [PSCustomObject]@{
                        VMName = $VM.Name
                        NetworkName = $VMNetAdapter.NetworkName
                        IP = $VMNic.Ip
                        Subnet = $VMNic.SubnetMask
                        DNS = [string]$VMNic.Dns
                        GW = $VMNic.DefaultGateway
                        }
          $VMNetConf +=$obj
     }
}

$VMNetConf | Export-csv -Path d:\mat\vmniclist.txt -NoTypeInformation -NoClobber -UseCulture

Here you can see the csv file after it has run in my test environment, one thing that I will extend with after discussing with some folks is the vlan number the port group the vm is connected to so that can be configured on the other side also.

Screen Shot 2013-08-15 at 23.30.25

And then I also with the possibility that there is in Hyper-V 2012, configure the network on the guest from the host, this requires that the virtual machine has the latest integration components installed. Ravikanth has done a blog post about how his function, I have added the possibility to run it from a remote computer

# Set-VMNetworkConfiguration
# Orginial by Ravikanth http://www.ravichaganti.com/blog/?p=2766
#
# Added computername to remotly set IP to guest from hosts
# Niklas Akerlund
Function Set-VMNetworkConfiguration {
    [CmdletBinding()]
    Param (
        
        [Parameter(Mandatory=$true,
                   Position=1,
                   ParameterSetName='DHCP',
                   ValueFromPipeline=$true)]
        [Parameter(Mandatory=$true,
                   Position=0,
                   ParameterSetName='Static',
                   ValueFromPipeline=$true)]
        [Microsoft.HyperV.PowerShell.VMNetworkAdapter]$NetworkAdapter,
        
        [Parameter(Mandatory=$true,
                   Position=2,
                   ParameterSetName='DHCP',
                   ValueFromPipeline=$true)]
        [Parameter(Mandatory=$true,
                   Position=5,
                   ParameterSetName='Static',
                   ValueFromPipelineByPropertyName=$true)]
        [String[]]$ComputerName=@(),

        [Parameter(Mandatory=$true,
                   Position=1,
                   ParameterSetName='Static')]
        [String[]]$IPAddress=@(),

        [Parameter(Mandatory=$false,
                   Position=2,
                   ParameterSetName='Static')]
        [String[]]$Subnet=@(),

        [Parameter(Mandatory=$false,
                   Position=3,
                   ParameterSetName='Static')]
        [String[]]$DefaultGateway = @(),

        [Parameter(Mandatory=$false,
                   Position=4,
                   ParameterSetName='Static')]
        [String[]]$DNSServer = @(),
         
        [Parameter(Mandatory=$true,
                   Position=0,
                   ParameterSetName='DHCP')]
        [Switch]$Dhcp
        
    )

    $VM = Get-WmiObject -Namespace 'root\virtualization\v2' -Class 'Msvm_ComputerSystem' -ComputerName $ComputerName | Where-Object { $_.ElementName -eq $NetworkAdapter.VMName } 
    $VMSettings = $vm.GetRelated('Msvm_VirtualSystemSettingData') | Where-Object { $_.VirtualSystemType -eq 'Microsoft:Hyper-V:System:Realized' }    
    $VMNetAdapters = $VMSettings.GetRelated('Msvm_SyntheticEthernetPortSettingData') 

    $NetworkSettings = @()
    foreach ($NetAdapter in $VMNetAdapters) {
        if ($NetAdapter.Address -eq $NetworkAdapter.MacAddress) {
            $NetworkSettings = $NetworkSettings + $NetAdapter.GetRelated("Msvm_GuestNetworkAdapterConfiguration")
        }
    }

    if ($Dhcp) {
        $NetworkSettings[0].DHCPEnabled = $true
    } else {
        $NetworkSettings[0].DHCPEnabled = $false
        $NetworkSettings[0].IPAddresses = $IPAddress
        $NetworkSettings[0].Subnets = $Subnet
        $NetworkSettings[0].DefaultGateways = $DefaultGateway
        $NetworkSettings[0].DNSServers = $DNSServer
        $NetworkSettings[0].ProtocolIFType = 4096
    }

    $Service = Get-WmiObject -Class "Msvm_VirtualSystemManagementService" -Namespace "root\virtualization\v2" -ComputerName $ComputerName
    $setIP = $Service.SetGuestNetworkAdapterConfiguration($VM, $NetworkSettings[0].GetText(1))

    if ($setip.ReturnValue -eq 4096) {
        $job=[WMI]$setip.job 

        while ($job.JobState -eq 3 -or $job.JobState -eq 4) {
            start-sleep 1
            $job=[WMI]$setip.job
        }

        if ($job.JobState -eq 7) {
            write-host "Success"
        }
        else {
            $job.GetError()
        }
    } elseif($setip.ReturnValue -eq 0) {
        Write-Host "Success"
    }
}

And here is the script that I run to configure the VM´s after the MAT has done the conversions, and yes as Mark says about MAT, there is room for improvements here also of course, As you can see I start with injecting the latest integration components into the VM, the sleep cmdlet is used to get the vm fully booted and integration components installed and then an reboot inside the VM.

# Configure and set VM after Conversion
#
# Niklas AKerlund / 2013-07-01

# Function import
. .\Set-VMNetworkConfiguration.ps1

$VMNICs = Import-CSV -Path D:\mat\vmniclist.txt -Delimiter ";"
$ConvertedVMs = Get-Content -Path D:\mat\VMlist.txt

# Configure each vm before starting
foreach ($ConvertedVM in $ConvertedVMs){
    $VM = Get-VM $ConvertedVM.Split(".")[0]
    write-host $VM.Name
    #patch each VM with latest Integration Tools
    $virtualHardDiskToUpdate =($VM | Get-VMHardDiskDrive).path
    $integrationServicesCabPath ="C:\Windows\vmguest\support\amd64\Windows6.x-HyperVIntegrationServices-x64.cab"

    #Mount the VHD
    $diskNo=(Mount-VHD -Path $virtualHardDiskToUpdate –Passthru).DiskNumber

    #Get the driver letter associated with the mounted VHD, note this assumes it only has one partition if there are more use the one with OS bits
    $driveLetter=(Get-Disk $diskNo | Get-Partition | where Size -GT 100MB).DriveLetter

    #Check to see if the disk is online if it is not online it
    if ((Get-Disk $diskNo).OperationalStatus -ne 'Online'){Set-Disk $MountedVHD.Number -IsOffline:$false -IsReadOnly:$false}

    #Install the patch
    Add-WindowsPackage -PackagePath $integrationServicesCabPath -Path ($driveLetter + ":\")

    #Dismount the VHD
    Dismount-VHD -Path $virtualHardDiskToUpdate
    
    Start-VM -VM $VM

    Start-Sleep -Seconds 300
    
    # Wait for the Integration components being installed and the server reboot (reboot requires interaction or automatic script inside VM or you will have to do an unclean poweroff

    Start-VM -VM $VM

    # check that the migrated VM actually has ic that responds 
    do {
        $notok = Get-VMIntegrationService -VM $VM | Select -First 1 | where PrimaryStatusDescription -eq "OK"
    } while( $notok -eq $null)

    # COnfigure NICs
    foreach ($VMNic in $VMNICs){
        write-host "Configuring" 
        if($VMNIC.VMName -eq $VM.Name){
           if(!(Get-VMNetworkAdapter -VM $VM)){
               $VMNetAdapter = Add-VMNetworkAdapter -VM $VM -SwitchName $VMNic.NetworkName -Passthru
               $VMNetAdapter | Set-VMNetworkConfiguration -IPAddress $VMNic.IP -DefaultGateway $VMNic.GW -Subnet $VMNic.SubnetMask -DNSServer $VMNic.Dns -ComputerName HV03
         
           }else {
           
               Connect-VMNetworkAdapter -VMName $VM.Name -SwitchName $VMNic.NetworkName
               $VMNetAdapter = Get-VMNetworkAdapter -VM $VM
               write-host "connecting $VMNic.NetworkName "
               $VMNetAdapter | Set-VMNetworkConfiguration -IPAddress $VMNic.IP -DefaultGateway $VMNic.GW -Subnet $VMNic.Subnet -DNSServer $VMNic.DNS -ComputerName HV03
          }
        }
    }

}

And after running as you can see in the Hyper-V manager I have the right IP on the VM (and if you check inside the VM, you will see that the dns,subnet and gateway also has been set correctly.

Screen Shot 2013-08-15 at 23.38.27

vExpert 2013

May 29th, 2013 3 comments

vexpert_logo_2013

This year I got the vExpert award again, this is the second year I get the title and feel honored to be part of the program :-)

I have two former colleagues from Sweden and my time at Real Time Services that also got the title this year and they are serious mega-experts :-)

Thank you John Troyer and all other involved in the vExpert program!

You can find the rest of the 580 vExperts on this link.

Categories: General, Virtualization, VMware Tags:

SC Orchestrator 2012 Sp1 and VMware vSphere 5.1

February 17th, 2013 1 comment

I have been exploring the System Center Orchestrator Integration Pack for vSphere and this is some good stuff! I have several customers that have bought Windows Datacenter Licenses with the System Center bundle and that is quite beneficial from a economical perspective! This means that they can use the System Center all parts with all VM´s and hosts. Several customers also use VMware vSphere as their virtualization platform and they can use System Center Orchestrator to build automation without any extra license cost.

In the System Center family there is only Virtual Machine Manager and Orchestrator that has connections to VMware vSphere without third party software (In Operations Manager you can use SNMP to get alarms from vCenter though).

So what can we do with Orchestrator IP for vSphere? This is the activities that is in the pack with version number 7.1.3010:

Screen Shot 2013-02-17 at 18.47.24

And what do we need to configure, well of course we need connection settings to a vCenter server and that is found under the “Options” and then you add your vCenter or if you have several and want to use them you will have to add one configuration for each.

Screen Shot 2013-02-17 at 19.12.05

And here is an simple example of a runbook that changes all VM´s memory to 384 MB, in the runbook I check if the VM is on or off and do an graceful power off activity depending on that status. For each activity in the runbook we have to add what configured vCenter we want to use or the runbook will fail!

Screen Shot 2013-02-17 at 19.19.42

The possibilites are almost endles as you can combine these activitiy with the others and interact with for example SCCM and deploy VM´s and OS. If this list of activities in the IP is not enough it can be extended by either creating your own IP or calling PowerCLI scripts from your runbook. Together with System Center Service Manager we can build nice self service portals that also does stuff on the VMware VM´s based on what the user order.

Categories: Automation, SCO, VMware Tags:

New version of the free vKernel Server Explorer

January 15th, 2013 No comments

There is a new version of the free Dell vKernel Server Explorer and now the version number is 6.3

What has been added to this valuable tool:

  • Storage Explorer
  • Change Explorer

So with the storage explorer view I can get valuable information about the capacity and also the configuration of the datastores, such as what path selection, number of VM´s and IO etc

With the Change Explorer I get an overview of what has changed in my environment, this is data from the latest 7 days and if I want more I can always activate the vOPS server trial and then buy an license.

The Server Explorer can be installed/imported into VMware vSphere or Microsoft Hyper-V and also Redhat Enterprise Virtualization, and you can connect it to several vCenter servers and also Hyper-V and RHEV at the same time :-)

I have tested to install it on Microsoft Hyper-V, I tried to use the guide and import the VM on a Windows 2008 R2 Hyper-V, this worked excellent. On windows 2008 r2 it is important that the config.xml file is present in the folder of the VM you try to import or it will fail, this is not a problem on windows 2012 hyper-v where you can import VM´s without exporting them first.

I changed the settings for the imported VM to

  • 4096 MB (I have also been able to start it with 2048 MB)
  • removed the legacy Network Adapter and replaced it with a Network Adapter (the synthetic)

Updated: The synthetic Network Adapter cannot be used when deploying on windows 2012 Hyper-V because the IC for linux on the vKernel Server Explorer appliance is version 3.1 and the OS is OpenSuse 11.4, and the IC 3.4 which is needed for 2012 cannot be installed on that OS. You can find out the version on your Linux VM by typing modinfo hv_vmbus or modinfo hv_netvsc for the network adapter. The recommendation from Microsoft is that you should use the Network Adapter when possible.

Screen Shot 2013-01-16 at 12.43.08

Then I started it and although the VM/VHD´s says 6.0 the VM after start says 6.3 So I know it is the latest and it starts successfully.

Screen Shot 2013-01-14 at 14.21.06

Next step is to configure the vKernel Hyper-V Collector, as you can see this is kind of mandatory before adding the System Center in the vOPS Server Explorer.

Screen Shot 2013-01-14 at 14.46.20

There are two different folders on the download and if you have System Center 2012 you should install the Hyper-V Collector 2012. If I had chosen the internal vOPS database I will use the SQL Server type PostgreSQL, the ip adress of the vOPS Server Explorer and the username and password postgres / postgres

Screen Shot 2013-01-14 at 16.05.27

Next step is to configure the connections tab where we add a connection to the SCOM server and when that is done we can after a while check the data in the web, the address is http://ip_of_the_vOPS , the name of my SCOM server is VMM12 so it is not the VMM server I connect to, although this server do have vmm and scom on the same OS.

Screen Shot 2013-01-14 at 21.57.44

Free tools are always nice and with these new change and storage explorers you get more insight into your environment and this for free!!

Good luck in your deployment of this updated tool!

Categories: Hyper-V, SCVMM, Virtualization, VMware Tags: