If you by some reason need to kill the process that is handling the VM in Hyper-V which is the Virtual Machine Worker Process, it can be handy to also know what vmwp process that correlates to what VM 😛 or you could accidently restart the wrong VM. Restarting the VM is the default behavior when the process dies.
If you look in the task manager of the Parent Partition you can see the processes.
If you look a bit deeper into the task manager you can see that each process in the command line have the virtual machine ID and then digging into this with PowerShell you can find out what VMWP process each VM has. I have been trying to use the Get-Process Cmdlet but that left me with no luck, then I found this post by Ravikanth that uses the Get-WmiObject instead, so I used that and altered what process to get.
I have made a oneliner that does this and as you can see on the following screendump I get a list of the VM´s and the Process Id´s.
Last week on the NIC keynote we could hear Jeffrey Snover talk about Windows 2012 and also that the preferred version when installing is Core, but then you will not have the Hyper-V manager locally (yes you could use the PowerShell module….).
So how do we enable our management station for remote Hyper-V tasks…
If you have a Windows 2012 you can easily just enable the Remote Server Administration Tools for Hyper-V and that preferably with PowerShell
And if you want to check if you have the Hyper-V management features installed you can use the Get-WindowsFeature
I usually also add the Failover cluster RSAT feature also to be able to manage the cluster.
If you want to add the Hyper-V tools in a Windows 8 you would guess that you have to use the DISM tools and there are some DISM cmdlets, You might have noticed that the Hyper-V tools are not part of the RSAT package for windows 8 this as the client Hyper-V role is part of the OS. But either I am doing something wrong or someone in Redmond has not thought this part through regarding the enabling of features in PowerShell for Win8!
because when I try the following Cmdlet with parameters
The PowerShell console barf out an error because when trying to add the Management tools with the powershell cmdlet I get info that it needs a parent feature which would be the Hyper-V feature and in this virtual windows 8 client that is not what I want,
When using the Control Panel, Add/Remove software/Windows Features you can add the Hyper-V Management tools in your Windows 8 without adding the Hyper-V Platform!
I will pursue this with some smart PowerShell gurus and see if they have an answer to why this happens 🙂
In the meantime good luck in creating your management pc!
As the articles on technet tells you it is not supported but I wanted to try and see how I could do it in my lab environment and what consequences it would have . I have one DC Server, one VMM/ORCH/SCOM server (maybe not best practice to have all three roles on the same server but it works 😀 ) and one Hyper-V host with some lab-VM´s
I started with the Orchestrator and when I connected the ISO to the server/servers and try to install I got an dialog that I already have it installed, but it is the wrong version so I have to uninstall everything first, So did that and then during the installation selected the old DB in the wizard and after that I could see all my runbooks and IP´s still are there.
Then It was time for the SC VMM, but now the installation guide clearly told me that I had to uninstall the product, although as you can read on the screen dump: if I am running SC 2012 I can retain the database when uninstalling.
In the uninstall wizard, be sure to check this box:
And then during the new installation be sure to point out the old database
The installation wizard will then check and ask if you want to upgrade it, pretty nice and for not supporting an upgrade they have made it quite easy to do it anyway!
Also, the wizard recognizes the library share that I had configured before. In the last step I get an summary that tells me what potential issues might occur with this upgrade, As you can read in the first part it is important to use the same server as the vmm was installed on before and that you use the same service account for VMM this for the Run-As accounts to work!
When the installation is complete I had to update the Agent on the Hyper-V host.
After this I continued to upgrade the SCOM, when starting the installation wizard I did not need to uninstall anything and right away the SCOM accepted an upgrade to the RTM version.
After successfully “upgrading” these components there are some more work that needs to be done, such as the SCOM-SCVMM integration that need upgrading and also Orchestrator IP that should be taken care of but that in another blog post 🙂
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.
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.
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.
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
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.
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!
I have altered his bits to work also when not running on a Hyper-V host (as Mount-VHD does not work when not Hyper-V is enabled), and you have the VM´s on a smb share, this also works if you take a snapshot and then copy the vhdx file to a windows 8 or windows 2012 machine.
The cool part is that I can use a UNC share path with Mount-DiskImage which is the Cmdlet used.
If I have the right permissions I can then easily with just a PowerShell script as Ben showed mount the virtual harddisk and copy the files, and this from a remote server and not on the Hyper-V host.
Get-VM core -ComputerName hv01 | Checkpoint-VM -SnapshotName "Need to look at these disks" -Passthru | %{Get-VHD -VMId $_.vmid -ComputerName $_.ComputerName} | %{Mount-DiskImage -ImagePath $_.ParentPath -Access ReadOnly -PassThru}
After I have run this you see that I can then get the secret file out of the running virtual machine
and when I am finished copying the secret files from the running virtual machine I can unmount the disk and remove the snapshot.
So what is the conclusion on this in a security perspective, as you can see it is quite easy for a person with the right permissions on a host level to get access of files that he or she maybe not should see. Talented hackers can get permissions and accounts that they need. This leads to the discussion of course where you should put your hosts, is it enough security and boundaries on your network and in your Active Directory Domain or should you set up another for the Hyper-V hosts and management servers?!
I live in Sweden and thus have Sweden as regional format setting and that did Powershell version 3 not like, at least not for the Get-WinEvent cmdlet 😛
Using powershell to change the format or culture is done with the following
Get-Culture
Set-Culture en-US
And when I open a new PowerShell Console I can see the messages for my Hyper-V events 🙂 not so good with the bug though..
Lets hope there is a bug fix soon, a bit embarrassing when some parts of the powershell console is not working in other regional settings besides en-US, are we in other parts of the world not that important or just an mistake by an developer, lets hope for the later..
A big thanks to Andreas Hultgren that was first to let me know about the bug 🙂
I have been trying to get some Events out of my test environment for some Hyper-V stuff.
What I have noticed when digging down into the Get-EventLog and Get-WinEvent I get different information
The Get-EventLog gives me information and message about the Windows Logs and there it works nicely as you can see
But when I try to get information from as in this case Hyper-V logs with Get-WinEvent I get no information in the fields LevelDisplayName and Messages?!
And in the Event Viewer you can see that the information is there:
Have I misunderstood something how to get the Events in PowerShell or is there a bug in the system? In the old “Windows 2008 R2” I got the information correctly as you can see on this screendump, so the Get-WinEvent issue is related to Win 2012 version!
It kind of sucks if I cannot search the messages for some data and collect that information, and what I can see it seems to be the same case for all application and services logs and I will not accept to have to go the Event Viewer GUI 🙂