Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Hyper-V PowerShell Automation

You're reading from   Microsoft Hyper-V PowerShell Automation Manage, automate, and streamline your Hyper-V environment effectively with advanced PowerShell cmdlets

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784391539
Length 124 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Vinith Menon Vinith Menon
Author Profile Icon Vinith Menon
Vinith Menon
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface 1. New PowerShell Cmdlets in Hyper-V on Windows Server 2012 R2 FREE CHAPTER 2. Managing Your Hyper-V Virtual Infrastructure 3. Managing Your Hyper-V Virtual Machines 4. Creating Reusable PowerShell Scripts Using Hyper-V PowerShell Module Cmdlets 5. The Next Step – Integration with SCVMM 6. Troubleshooting Hyper-V Environment Issues and Best Practices Using PowerShell Index

Virtual machine generation

With the introduction of the concept of virtual machine generation in Windows Server 2012 R2, the virtual machines have been classified broadly into two generations: generation 1 and generation 2. Generation 1 VMs can boot only from a disk attached to the IDE controller or network boot from a legacy network adapter. In addition, the boot configurations are taken care by BIOS. Generation 2 virtual machines are UEFI-based, which gives us features like secure boot; it allows us to boot the virtual machines from the SCSI disk and there is no requirement for an IDE controller-based boot method. Also, it allows network boot over the synthetic network adapter. Generation 2 virtual machines are UEFI based; this feature is supported only on windows 2012 or later versions and only on 64-bit operating systems. The boot time in generation 2 virtual machines is quicker than generation 1 virtual machines.

Creating either generation 1 or generation 2 virtual machines is very simple with PowerShell. You just need to specify an integer value for the generation parameter. The following examples show how you can go about doing this:

  • To create a generation 1 virtual machine, you can specify the generation type as 1, as shown in the following example:
    New-VM –Name "new 3" –MemoryStartupBytes 1GB –VHDPath d:\vhd\BaseImage.vhdx -Generation 1
    

    Note

    For these examples, you have the BaseImage.vhdx file placed at d:\vhd.

  • Similarly, to create a generation 2 virtual machine, you can specify the generation type as 2, as shown in the following example:
    New-VM –Name "new 3" –MemoryStartupBytes 1GB –VHDPath d:\vhd\BaseImage.vhdx -Generation 2
    
You have been reading a chapter from
Microsoft Hyper-V PowerShell Automation
Published in: Jan 2015
Publisher:
ISBN-13: 9781784391539
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image