Showing posts with label Hyper-V. Show all posts
Showing posts with label Hyper-V. Show all posts

Thursday, December 17, 2015

The Joy of Modern Computing

  1. Solaris Zones & Containers
  2. Oracle VirtualBox
  3. Xen 
  4. VMware
  5. KVM 
  6. Heroku
  7. Hyper-V 
  8. Citrix XenServer 
  9. Oracle VM Manager (OVM) 
  10. Amazon Web Services (AWS) 
  11. Microsoft Azure Cloud Services
These are a few of my favorite virtualization platforms that I've been using since 2006. I love virtualization!  I work mainly out of a virtualized desktop running ssh into virtualized systems.   Lately, I've been working a lot with Microsoft Azure Cloud Services.

It's funny how this is perceived by some people unfamiliar with it.  Today in a meeting, some people thought that moving systems to the "cloud" would cause a loss of IT positions.  I never thought so.  My least favorite part of the job is the part that takes .001% of your time - mounting the physical hardware in a rack and wiring it.  If that goes away, I will not miss it at all.

I love that I can clone, copy and snapshot VMs.  Using physical hardware now seems to me like working without a net. I would not want to go back.  Even better is having the services in the cloud.  No messy wires, no failing hard drives (I have an open ticket for one now).  Even backups are a breeze.

I have a 32 bit Windows 7 desktop VM that I migrated from a PC running CentOS 5 under Xen to a PC running Red Hat Linux 6 running KVM (that was a tough migration - but it worked!) and then I moved it again to a PC running Oracle Linux 7 under KVM (much easier move).  So, my Windows 7 has been with me through 3 PCs.  All of my stuff is there - all my files and software.  Virtualized PC's are really cool!

I also run additional VMs on my PC.  If a new distro comes out and I want to see what it looks like - I just load it from the ISO!  I don't have to have spare hardware.  It's great!  I have been running my desktop like this about 6 years and can't imagine doing it any other way.  (I started virtualizing my servers almost 10 years ago).

Lately, as I have built about a dozen various VMs in Azure.  I've been testing the cloning of VMs & filesystems and securing endpoints. (It took some time to figure out how to reserve static addresses.)

Now, I love Linux and my technology passion is learning pretty much anything OpenSource - BUT, even though I could do quite a bit with the cross platform kit for Azure under Linux - most of the work was easier in Powershell.  No problem - because I really like Powershell - BUT, my 32 bit Windows 7 system didn't seem to want to finish the install and hung twice.  I figured it was because it was 32 bit.  Again, thanks to virtualization - No problem - I just loaded up 64 bit Windows 10.  (I tried to like Windows 8 and 8.1 but eventually gave up. Skipping that one.)  Windows 10 is a nice mix and seems more intuitive then its predecessor and ran the Azure Powershell environment which made cloning much easier.

The cool thing is, I can still run my old Windows 7 for as long as it gets patches (and then I could just remove the network and keep it for nostalgia) BUT I also get to run Windows 10 and use the Azure Powershell features I need.

Anyway, Linux and KVM gives you a lot of possibilities and it's free (your VMs, may not be). 


Thursday, December 18, 2014

iSCSI with Powershell and Hyper-V on Windows Core 2012 R2

I found a great link for working with iSCSI drives from Powershell.  The first thing you have to do is turn on iSCSI:

PS C:\Windows\system32> Set-Service -Name MSiSCSI -StartupType Automatic
PS C:\Windows\system32> Start-Service MsiSCSI

Next, tell Windows Server Core where your SAN resides:

PS C:\Windows\system32> New-IscsiTargetPortal -TargetPortalAddress 192.168.12.34
0
 
 
InitiatorInstanceName  :
InitiatorPortalAddress :
IsDataDigest           : False
IsHeaderDigest         : False
TargetPortalAddress    : 192.168.12.34
TargetPortalPortNumber : 3260
PSComputerName         :

I would have thought at this point it would know the iSCSI share but it did not.  Had to run this command:

PS C:\Windows\system32> $target = Get-IscsiTarget
PS C:\Windows\system32> print $target.NodeAddress
Can't find file iqn.2003-06.com.equallogic:0-bf1bf6-56acce3eb-fd0030124795492f-testvol1

PS C:\Windows\system32> Connect-IscsiTarget -NodeAddress $target.NodeAddress

You just need the above TWO commands in black.  I ran the line in red to see what it was looking at (making certain of the IQN before proceeding).  The Connect-IscsiTarget command responds with this:

AuthenticationType      : NONE
InitiatorInstanceName   : ROOT\ISCSIPRT\0000_0
InitiatorNodeAddress    : iqn.1991-05.com.microsoft:testsrv.example.com
InitiatorPortalAddress  : 0.0.0.0
InitiatorSideIdentifier : 412341375678
IsConnected             : True
IsDataDigest            : False
IsDiscovered            : True
IsHeaderDigest          : False
IsPersistent            : False
NumberOfConnections     : 1
SessionIdentifier       : ffffe000cd87c020-4012313700056702
TargetNodeAddress       : iqn.2003-06.com.equallogic:0-bf1bf6-56acce3eb-fd00301...-testvol1                      TargetSideIdentifier    : 4f00
PSComputerName          :

Testing the iSCSI session...

PS C:\Windows\system32> Get-IscsiConnection


ConnectionIdentifier : feffe060cd87c029-1
InitiatorAddress     : 0.0.0.0
InitiatorPortNumber  : 15552
TargetAddress        : 192.168.12.34
TargetPortNumber     : 3260
PSComputerName       :

Looks good so you permanently register it (you don't want your iSCSI volumes disappearing after a reboot after all this).


PS C:\Windows\system32> Get-IscsiSession | Register-IscsiSession

Now, check to see if you have a iSCSI session:

PS C:\Windows\system32> get-IscsiSession


AuthenticationType      : NONE
InitiatorInstanceName   : ROOT\ISCSIPRT\0000_0
InitiatorNodeAddress    : iqn.1991-05.com.microsoft:testsrv.example.com
InitiatorPortalAddress  : 0.0.0.0
InitiatorSideIdentifier : 400301370020
IsConnected             : True
IsDataDigest            : False
IsDiscovered            : True
IsHeaderDigest          : False
IsPersistent            : True
NumberOfConnections     : 1
SessionIdentifier       : bfbfe030cd87c020-400201370020d002
TargetNodeAddress       : iqn.2001-05.com.equallogic:0-af1bf6-66acce3eb-fd02300
                          24795492f-testvol1
TargetSideIdentifier    : 4f00
PSComputerName          :

Looking good.  Now check your drives again:

PS C:\Windows\system32> get-disk

Number Friendly Name                            Operationa Total Size Partition
                                                lStatus                Style
------ -------------                            ---------- ---------- ---------
0      XENSRC PVDISK SCSI Disk Device           Online          88 GB MBR
1      XENSRC PVDISK SCSI Disk Device           Online          40 GB MBR
2      EQLOGIC 100E-00 SCSI Disk Device         Online       77.01 GB RAW

You can see the Dell Equalogic SAN volume has been added as disk number 2.
Now you just need to format the disk and give it a drive letter:

PS C:\Windows\system32> Get-Disk | Where partitionstyle -eq 'raw' | Initialize-D
isk -PartitionStyle MBR -PassThru | New-Partition -AssignDriveLetter -UseMaximum
Size | Format-Volume -FileSystem NTFS -NewFileSystemLabel "iDisk3" -Confirm:$fal
se

DriveLetter FileSystemL FileSystem  DriveType  HealthStat SizeRemain       Size
            abel                               us                ing
----------- ----------- ----------  ---------  ---------- ----------       ----
F           iDisk3      NTFS        Fixed      Healthy      76.91 GB      77 GB

Remember: Get-Disk | Where partitionstyle -eq 'raw' is CRUCIAL if you do not want to initialize a disk with data on it already.

That's it.  You've added an iSCSI drive from the command line.