One of the things that Microsoft has stated is that the exams are going to be more PowerShell intensive. So, I wanted to add a PowerShell section showing the different PowerShell commands that you can use for Hyper- V. The information in Table 2.6 has been taken directly from Microsoft’s websites. The table explains just some of the PowerShell commands that you can use with Hyper- V.
Table 2.6 shows you just some of the PowerShell commands for Hyper- V. To see a more comprehensive list, please visit Microsoft’s website at https://docs.microsoft.com/en- us/powershell/module/ hyper- v/?view=win10- ps.
PowerShell Commands 75 | |||
TABLE 2.6 | Hyper-V PowerShell commands | ||
Command | Explanation | ||
Add- VMDvdDrive | Adds a DVD drive to a virtual machine | ||
Add- VMHardDiskDrive | Adds a hard disk drive to a virtual machine | ||
Add- VMMigrationNetwork | Adds a network for virtual machine migration on one or more virtual machine hosts | ||
Add- VMNetworkAdapter | Adds a virtual network adapter to a virtual machine | ||
Add- VMSwitch | Adds a virtual switch to an Ethernet resource pool | ||
Checkpoint- VM | Creates a checkpoint of a virtual machine | ||
Convert- VHD | Converts the format, version type, and block size of a virtual hard disk file | ||
Copy- VMFile | Copies a file to a virtual machine | ||
Debug- VM | Debugs a virtual machine | ||
Disable- VMConsoleSupport | Disables keyboard, video, and mouse for virtual machines | ||
Disable- VMMigration | Disables migration on one or more virtual machine hosts | ||
Dismount- VHD | Dismounts a virtual hard disk | ||
Enable- VMConsoleSupport | Enables keyboard, video, and mouse for virtual machines | ||
Enable- VMMigration | Enables migration on one or more virtual machine hosts | ||
Enable- VMReplication | Enables replication of a virtual machine | ||
Enable- VMResourceMetering | Collects resource utilization data for a virtual machine or resource pool | ||
Export- VM | Exports a virtual machine to disk | ||
Export- VMSnapshot | Exports a virtual machine checkpoint to disk | ||
TABLE 2.6 Hyper-V PowerShell commands (Continued)
Get- VHD | Gets the virtual hard disk object associated with a virtual hard disk |
Get- VHDSet | Gets information about a VHD set |
Get- VHDSnapshot | Gets information about a checkpoint in a VHD set |
Get- VM | Gets the virtual machines from one or more Hyper-V hosts |
Get- VMDvdDrive | Gets the DVD drives attached to a virtual machine or snapshot |
Get- VMHardDiskDrive | Gets the virtual hard disk drives attached to one or more virtual machines |
Get- VMMemory | Gets the memory of a virtual machine or snapshot. |
Get- VMNetworkAdapter | Gets the virtual network adapters of a virtual machine, snapshot, management operating system, or of a virtual machine and management operating system |
Get- VMProcessor | Gets the processor of a virtual machine or snapshot |
Get- VMReplication | Gets the replication settings for a virtual machine |
Get- VMSwitch | Gets virtual switches from one or more virtual Hyper-V hosts |
Merge- VHD | Merges virtual hard disks |
Mount- VHD | Mounts one or more virtual hard disks |
Move- VM | Moves a virtual machine to a new Hyper-V host |
New- VHD | Creates one or more new virtual hard disks |
New- VM | Creates a new virtual machine |
New- VMGroup | Creates a virtual machine group |
New- VMSwitch | Creates a new virtual switch on one or more virtual machine hosts |
PowerShell Commands
TABLE 2.6 Hyper-V PowerShell commands (Continued)
Command | Explanation |
Set- VMSwitch | Configures a virtual switch |
Stop- VM | Shuts down, turns off, or saves a virtual machine |
Suspend- VM | Suspends, or pauses, a virtual machine |
Summary
Virtualization is quickly becoming a hot topic in information technology. The potential for consolidation is tremendous, and thus it will become more and more important.
After reading this chapter, you should have a good understanding of the Hyper- V architecture and what is required to install Hyper-V .
The section about installation and configuration covered various basic aspects of configuring the virtualization environment. You learned about the types of virtual networks that are available, the options for installing the Hyper- V role, and the types of virtual hard disks that you can use to optimize virtualization for your specific scenario.
You also learned how to configure virtual machines using the Hyper-V environment and how to create your own virtual datacenter on top of your Hyper- V machines. I showed you how to create and manage virtual machines, how to use Virtual Machine Connection to control a virtual machine remotely, and how to install Hyper-V Integration Components. You also learned how to export and import virtual machines as well as how to do snapshots of your virtual machine.
If you have never worked with virtualization software before, the information in this chapter may have been completely new to you. You should now be well prepared to try Hyper- V in your own environment.
Leave a Reply