Quantcast
Channel: Hyper-V forum
Viewing all 19461 articles
Browse latest View live

Convert powershell WMI code to attach a floppy drive to c#

$
0
0

Hey guys, i want to programamtically attach a vhd to a  VM in hyperv 2,

so far i have got the following powershell code, and it works fine

$HyperVServer ="server"
$VMName = "vmname"
$VMMS = gwmi -namespace root\virtualization Msvm_VirtualSystemManagementService -computername $HyperVServer
$VM = gwmi MSVM_ComputerSystem -filter "ElementName='$VMName'" -namespace "root\virtualization" -computername $HyperVServer
$SystemSettingData = $VM.getRelated("Msvm_VirtualSystemSettingData") | where {$_.SettingType -eq 3}
$FloppyDrive = $SystemSettingData.getRelated("Msvm_ResourceAllocationSettingData") | where{$_.ResourceType -eq 14}
$vfdPath = pathtovfd
$FloppyAllocationCapabilities = (gwmi -computername $HyperVServer -namespace root\virtualization Msvm_AllocationCapabilities -filter "ResourceType=21 and ResourceSubType='Microsoft Virtual Floppy Disk'").__Path.Replace('\', '\\')
$FloppySettingsData = [wmi](gwmi -computername $HyperVServer -namespace root\virtualization Msvm_SettingsDefineCapabilities -filter "GroupComponent='$FloppyAllocationCapabilities' and ValueRange=0").PartComponent
$FloppySettingsData.Connection = $vfdPath
$FloppySettingsData.Parent = $FloppyDrive.__Path
$result = $VMMS.AddVirtualSystemResources($VM, $FloppySettingsData.GetText(1))

But the problem is that i want these things in c#, currently we are using ManagementScope, Management Object and ManagemenClass to perfom all teh Hyper v WMI operations,

but im unable to crack down the code to attach VFD to a VM,,

Can any one provie me a c# wmi's version of above code.. I know that i can use the above powershell code directly, but we have all other codes written in wmi classes, and also we need to track the status of the result ... 

so can any one help me here plz....


Error in Hyper-V guest backup on parent partition

$
0
0

I have installed 3rd party application for hyper-v guest backup. yesterday i have ran backup on one of my guest OS after backup done its shows error in report. 

ERROR :-  Replication BA953 Volume Shadow Copy Error 0x800423f3 - writer error: retryable

 Is there any workaround???.



Akshay Pate


PowerShell remoting fails to move a VM from one host to another host

$
0
0

This is for Hyper-V 2012 servers under Windows 2003 domain. CredSSP is not supported.

This command works:

move-vm  -name vm1  -computername hypervA  -destinationhost hypervB

This one is not working:

$pss = new-pssession -computername hypervA
invoke-command -session $pss {move-vm -name vm1 -destinationhost hypervB}

The error is "You do not have permission to perform the operation. Contact your administrator if you believe you should have permission to perform this operation."

Both hypervA and hypervB have delegation enabled for each other for "Microsoft virtual system migration service" and CIFS enabled for the SMB server.

What else needs be enabled for the powershell remoting?

Thanks.


Deleting a Snapshot with Powershell

$
0
0

I have been writing scripts to automatically take snapshots everynight.  Those work fine but I also need the ability to delete snapshots via powershell and that is where my problem is.  Here is my deletion script:

# Prompt for the Hyper-V Server to use
$HyperVServer = 'Hyperv Machine'
# Prompt for the virtual machine to use
$VMName = '01-vm'
# Prompt for the name of the snapshot to delete
$SnapshotName = 'DailyBackup'
# Get the management service
$VMMS = gwmi -namespace root\virtualization Msvm_VirtualSystemManagementService -computername $HyperVServer
# Get the virtual machine object
$VM = gwmi MSVM_ComputerSystem -filter "ElementName='$VMName'" -namespace "root\virtualization" -computername $HyperVServer
# Find the snapshot that we want to delete
$Snapshot = gwmi -Namespace root\virtualization -Query "Associators Of {$VM} Where AssocClass=Msvm_ElementSettingData ResultClass=Msvm_VirtualSystemSettingData" | where {$_.ElementName -eq $SnapshotName} | select -first 1
# Delete the snapshot
$result = $VMMS.RemoveVirtualSystemSnapshot($Snapshot)

I got this script from here : http://blogs.msdn.com/b/virtual_pc_guy/archive/2011/10/20/deleting-a-snapshot-via-powershell-hyper-v.aspx

My problem is when I hit the line 

$Snapshot = gwmi -Namespace root\virtualization -Query "Associators Of {$VM} Where AssocClass=Msvm_ElementSettingData ResultClass=Msvm_VirtualSystemSettingData" | where {$_.ElementName -eq $SnapshotName} | select -first 1

I get the error gwmi: not supported

All help is greatly appreciated!!

Could not create VM in a shared path on the same machine, what extra permissions do I need.

$
0
0

Case1:

I have a Hyper-V host M1, and on the same machine I have a share \\M1\SharedFolder.

I have given full control for the logged in user and full control for the machine account of M1 (Domain\M1$). I have given both share and NTFS permissions. When I try to create a VM in M1 while storing vhd on '\\M1\SharedFolder' it is failing with an access denied error 0x80070005. There is no need of constrained delegation or anything here right as the share is on the same machine. What extra permissions I need to give.

Case2:

I have a Hyper-V host M1, and share on machine M2, share path is \\M2\SharedFolder.

I have give full control (NTFS & share) permissions for machine account of M1 (Domain\M1$) and the logged in user on the sharepath '\\M2\SharedFolder'. When I try to create a VM in M1 while storing vhd on '\\M2\SharedFolder' it is successful. Why did it didn't work above, and its working in this case, what explains this behavior.

My machine M1, M2 are Windows Server 2012. 

Hyper-V and Display resolution

$
0
0

Hi there,

 

I am trying to increase the display resolution to 1600x1050 for my virual server (Hyper-v), but the max I can get is 1280x1024.

I installed the Integration services and all the updates for the host os (win 2008 Enterprise) and guest os (win 2003 R2 Enterprise).

 

any idea?

 

Thanks,

LOA

Use default credentials for Linux guests?

$
0
0

So, have a Debian/Ubuntu* guest, and I noticed that Integration Services report as being offered. I didn't think that this applied to the user credentials setting, but I started searching online, and now I'm not sure if it is or not. Is this an available setting for Linux guests?

*I know that Debian/Ubuntu are not OFFICIALLY supported (only RHEL, I believe), but if someone can point me in the right direction of how RHEL makes this magic work, I'd love to do some digging to make it work on other *nix distros.

Live Migration between different Intel CPUs (in a lab)

$
0
0

Does anyone know of a table or matrix to lookup which hyper-v features can be enabled and still do Live Migration between different Intel processors?  The servers below are available for a test lab to build a simple failover cluster, it won't be used for anything important.  When I tested something like this a couple years ago, Hyper-V management console in 2008 R2 would perform the LM just fine, but SCVMM 2008 R2 wouldn't allow it. This time we're planning to use Server 2012 and VMM 2012 SP1, we just don't want to spend time building the cluster and VMs and then find out we can't do live migrations at all.

The result below is from the cluster validation report.

Validate Matching Processor Manufacturers

Description:

Validating processor manufacturer compatibility.

Validate that all specified nodes share the same processor manufacturer.

Node

Processor Manufacturer

Version

server1.domain.com

GenuineIntel

Intel64 Family 6 Model 23 Stepping 10

server2.domain.com

GenuineIntel

Intel64 Family 6 Model 15 Stepping 6

server3.domain.com

GenuineIntel

Intel64 Family 6 Model 15 Stepping 11

The processor version is not consistent across all the nodes. This is important because Hyper-V may not be able to live migrate a virtual machine between processors of different versions.



HyperV 2012 JBOD architecture design and workloads

$
0
0

I'm currently studying architectural design considerations for deployment of HyperV 2012. We are currently utilizing Vsphere 5.0 essentials deployed on internal drive enclosures and had been planning to upgrade Vsphere licensing to utilize Vstorage for storage HA.

I do understand the possibility of leveraging many of the new scale out and HA capabilities provided in Win 2012 on top of the Vsphere platform, but have made a commitment to HyperV 2012 for the integration, standardization, technical skill set, and cost savings benefits that Windows 2012 now offers to small to mid sized customers.

I have never dealt with centralized storage, (SAN, NAS, JBOD, etc) in the past, and am designing a JBOD approach to my Win 2012 HyperV solution. I think I have my arms somewhat around this but would like some input on my approach, and possible pitfalls.

Workloads are very simple and low Volume: File services, AD, Exchange (will be 2013), Utility services (DNS, DHCP, Print, etc), SharePoint 2010/2013, Windows hosted web services, possible future virtualization of SQL server(Currently dedicated).

Hardware architecture is very basic also: 2 HP DL370 G6, currently utilizing 2 drive enclosures in each with Vsphere, (1 dedicated to VM's, 1 dedicated to data VMDK's) on each box.

My new approach for HyperV 2012 is to utilize 1 internal enclosure on each box to host VM's, and to deploy JBOD storage for data.

  • JBOD options are: 2 single interface JBOD's, 2 dual interface JBOD's, 1 Dual backplane Single interface per, 1 Dual Backplane dual interface JBOD

Proposed HyperV configuration is:

  • HyperV clustering of the 2 boxes
  • SoFS role at the host level with CSV shares to expose HA data to VM roles that can leverage this type of share, eg.(file servers)
  • Dice up some of each JBOD into mirroring to support roles such as Exchange DAG, and possible later SQL Server clustering. eg(1, (2 disk mirror) on each JBOD, Exchange installation maps to the mirror on it's direct attached JBOD for local copy of the database). Other work loads not utilizing host level CSV's would utilize other mirrors on their locally attached JBOD.

Points I'm seeking advice and opinions on:

  • Transparent failover is a nicety for me, short failover periods are acceptable. Very few of the VM's will likely be eligible
  • DataON is the only JBOD that I know of that is currently certified, it is a dual backplane, 2 interface per device, cost wise not too bad +-$5,500 for 24 bay. Believe it or not mgmt. will even cry about that. Per failover needs I believe 1 dual back plane single interface JBOD would be acceptable.....need comments on this, and the fact that I would be using a non-certified JBOD going with the later.
  • I know there are some issues with roles like Exchange DAG and SQL server clustering on top of HyperV clustering, are these issues alleviated simply by designating those roles as not HA on a HyperV cluster or should I simply not deploy a HyperV cluster, only the SoFS role at the host level?
  • I believe I have clarified SoFS at the host level is perfectly acceptable and understand that it could also be moved to the VM layer, just seems more versatile at the host layer, any comments or opinions?
  • Last, since I haven't dealt with JBOD's before I am a little perplexed by the Dual controller to separate JBOD's. I can understand this when redundancy is not provided through service like Storage Spaces and CSV's. There doesn't seem to be any need for this is my situation is there?

Thanks a lot everyone, not looking for absolute details I know this is a lot. Just clarification and opinions as at some of these layers I think I understand how to approach things, just worried about the pitfalls.

Chuck

   

Have Hyper-V questions? Live Q&A with Microsoft Virtualization Experts! (Microsoft Virtual Academy)

$
0
0

Hi,

The IT Pro Evangelism team, Microsoft Learning and the Microsoft Virtual Academy are pleased to announce the next FREE&PUBLIC event Live Q&A: Introduction to Hyper-Von Wednesday April 3<sup>rd</sup>, from 8:30am – 10:00am PST with virtualization experts Jeff Woolsey& Symon Perriman.

Just us in this live online event designed for IT professionals that have questions about Microsoft virtualization and want to learn about Windows Server 2012 Hyper-V.

Register here: http://aka.ms/MVAf-HyperV. If you cannot make the live event, sign up anyway so you can receive a notification when the recording is published on the Microsoft Virtual Academy.

Topics and demos may include:

  • Introduction to Microsoft Virtualization
  • Hyper-V Infrastructure
  • Hyper-V Networking
  • Hyper-V Storage
  • Hyper-V Management
  • Hyper-V High Availability and Live Migration
  • Integration with System Center 2012 Virtual Machine Manager
  • Integration with Other System Center 2012 Components

 

Also check out our recent full day training Microsoft Virtualization for VMware Professionals Jump Start which is now available on theMicrosoft Virtual Academy.

Thanks!
Symon Perriman

Senior Technical Evangelist
Cloud & Virtualization
Microsoft

The best (free?) method to manage Hyper-V Server 2008 R2 and VM's using GUI

$
0
0
Hello All, I am looking for a piece of software that i could use free of charge in test environment - so many Vm's on the same, only 1 host. 1 Host with 1 or 2 physical CPU's and 20+ VM's on it. I have found Virtual Machine Manager R2 but i suppose i would have to pay for the license to use it? I am looking for equivalent of VMware vSphere Client. is there anything like it for Hyper-V? Cheers, Jacek P.S. (I have MSDN license)

Windows Server 2012 hyper-v cannot create virtual switch at the time of installation

$
0
0

We have 2 HP prolion 380p server. It has 4 NIC. When we going to install hyper-v role in that server(Windows Server 2012), it cannot create the virtual switch and shows following error.

Event ID 33204

Source Hyper-v-VMMS

Description: Hyper-v setup: could not create a virtual Ethernet switch bound to adapter "Brodcom NetXtreme Gigabit Ethernet #2" Invalid parameter(0X80041008)

Event ID 26138

Source Hyper-v-VMMS

Description: Failed while creating virtual Ethernet switch.

Event ID 26092

Source Hyper-v-VMMS

Description: External Ethernet adapter "Brodcom NetXtreme Gigabit Ethernet #2" is not enabled or not functional.


Mithun Dey Web: http://cloudmithun.wordpress.com

Hyper-V manager on Windows 7 "Cannot connect to the RPC service on computer ..."

$
0
0

Hello,

The most frustrating part about this situation is that it worked fine for a couple of weeks.  I was able to use the Hyper-V manager from a Windows 7 Pro workstation in a workgroup. Now I keep getting the message: "Cannot connect to the RPC Service on computer ..."

The gist of my configuration is this:

- Workgroup

- Hyper-V server 2012

- Client: Windows 7 Pro 32 bit

I have followed the Microsoft support information and several TechNet links to the letter and everything worked fine.  Now I get the message of death. Any advice?


With local storage, should DFS-R be on Parent or VM?

$
0
0

I recently went down the road of trying to make local RAID storage HA. I’m currently trying products such as Starwind and Open-E.  However, I’m now considering just going back to DFS-R.

Setup:

Two nodes at two locations for a total of four nodes.  All running Windows 2012 Server with local storage.

Goal:

24/7 access to updated data at either location.

Thoughts:

  • I know DFS-R will work as I’ve used it many times before, but never in close relation to Hyper-V. My storage is local, so I’m thinking that the DFS-R should sit directly on each Parent partition. Any arguments to the contrary?
  • Is it worth looking into BranchCache too, or will that cause headaches when used with DFS-R?
  • As for the VM’s, I’m pretty sure I can still make them HA using SMB 3.0, but I know Hyper-V Replica will go a long way if not. Thoughts?
  • With regards to DFS-R, is Peerlock still the go to solution for making sure files are locked across the WAN?

Feel free to mention anything that I’m not smart enough to think of, thanks.

Stop-VM Does Not Gracefully Shut Down Virtual Machine

$
0
0

Hi.  I'm running Hyper-V on Windows Server 2012.  I have a guest VM that I can shut down gracefully via the Hyper-V Manager (right-click on VM and select "Shut Down"). 

I can also shut this VM down gracefully via PowerShell using the older WMI method that is documented here:
     http://blogs.msdn.com/b/virtual_pc_guy/archive/2008/01/30/shutting-down-a-hyper-v-virtual-machine.aspx

However, when I shut it down via PowerShell using the nifty, new Stop-VM command, I get the following error:
 - Confirm
 - Hyper-V cannot shut down virtual machine ChiefCollig because the Shutdown integration service is unavailable. To avoid potential data loss, you can pause or save the state of the virtual machine. The other option is to turn off the virtual machine, but data loss might occur.

If I select "Y", the VM is crashed as if I turned off the virtual power switch.

If  I query the integration services of the VM using the Get-VMIntegrationService command, here's the result.
VMName      Name                               Enabled PrimaryStatusDescription SecondaryStatusDescription
------            ----                                   -------     ------------------------           --------------------------
ChiefCollig   Time Synchronization       True      OK
ChiefCollig   Heartbeat                        True      OK
ChiefCollig   Key-Value Pair Exchange True      OK                                     The protocol version of the component installed...
ChiefCollig   Shutdown                        True      OK
ChiefCollig   VSS                                  True      No Contact

"Hey, Van.  It appears that the Hyper-V integration services have been installed on the VM, but why isn't the VSS component in contact with the host?" 

OK, full disclosure time!  I suspect that the VSS component is out of contact because the guest OS is some flavor of Linux, although I'm not sure which flavor.  The VM is actually a Sophos UTM virtual appliance that I installed from scratch into the Guest.  The installation process sensed that it was a Hyper-V environment and it installed appropriate drivers.  It also appears that Hyper-V Integration Services was installed as part of this process.

All of this said, the integration services shutdown component is in contact with the host.  Isn't this enough for a graceful shutdown?

"Hey, Van.  How do you know that Stop-VM crashes the VM while the Hyper-V Manager and the WMI methods gracefully shut it down?" 

That's a great question.  I monitor the console the VM to make the determination.

When I use Stop-VM, the VM is powered off within a couple of seconds.  And when I turn it back on, it complains about recovering from a unscheduled shutdown.

When I use Hyper-V Manager or WMI via PowerShell, the VM takes a minute or so to shutdown, and the console shows all of the various services and components being stopped during the shutdown process.

So in summary, 2012 Hyper-V is able to shutdown the VM gracefully from the Hyper-V Manager Console and also from PowerShell via the WMI method.  Hyper is NOT able to shut the VM down gracefully via the new PowerShell Stop-VM command.

Does anyone have any theories or suggestions?

See Ya!
Van


Venice, FL, USA


SR-IOV support for Storage Controller in Hyper-V windows 2012 server

$
0
0

Hi,

I need to support  SR-IOV for PCIe based Storage Controller(with 16 VF) using Hyper-V windows 2012 server.

But I am clueless since there is no documentation regarding this and all present documentation is for NDIS only.

How to write VF and or PF driver ? What will be the role of IOMMU e.g intel VT-d?

What modifications are needed in existing storport based miniport(SCSI) driver.

Any help will be highly appreciated.

TIA

Naren

Snapshot - General access denied error (0x80070005).

$
0
0

Hi,

 When trying to snapshot a VM i get:

'vm1' could not create auto virtual hard disk C:\Virtual Guests\vm1\vm1_B4F0796F-3EB5-4810-BA04-CA8E1DA3774C.avhd: General access denied error (0x80070005). (Virtual machine ID AE6E811F-A056-4A1C-A501-287914A13021)

I looked around on the web, and found that the 'Virtual Machines' group isn't on my server, and therefor isnt on the security tab for my snapshot folder.

Taken from this post: http://joesitblogandotherstuff.blogspot.com/2010/01/could-not-initiate-snapshot-operation.html

How do I manually create the 'Virtual Machines' group, so I can make snapshots work again?

 


KL_Dane

Server 2012 Hyper-V hypervisor not running on compatible CPU

$
0
0

Hi,

I'm having this issue with my AMD Turion X2 laptop (Hypervisor launch failed; the hypervisor boot loader's internal logic failed (BalStatus 0x19, sub-status 0x2))...but as you can see coreinfo is giving me SVM supported...it's just that the hypervisor won't run no matter what I try?

Any chance I could see why isn't it running...the only thing I suspect could be wrong is video drivers (but I thought you only need those for RemoteFX - which I don't really need - I just want to run WP8 emulator)...but I could only find some legacy Radeon 3200 drivers probably without Hyper-V optimization in them (are there any other drivers)?



Setting-up network and internet for guest machine using Windows 8 Hyper-v Client

$
0
0
I'm comfpletely new to Hyper-v.

I'm using the Hyper-v that came with Windows 8. I am using the Windows Phone emulator and it has internet access. However, I created a new XP machine and have been unable to get network/internet access. I have been reading the posts here and other info but no luck yet. Below are my network settings for the guest machine.

Thanks in advance for any advice you may have!

Migrate from VMware to Hyper-V 2012 with single SAN

$
0
0
Hi We currently have a 2 node VMware cluster connected to an iSCSI SAN running esx 4.1. Our VMware maintenance runs out in just under a years time and we would like to plan a migration from VMware to hyper-v. All of our infrastructure sits on the SAN. (We do have replicated dr and backup but that's not important) What we want to do is migrate all guests from VMware to hyper-v with as little down time and risk as possible. We also have a 3 node hyper-v node connected to a much smaller iSCSI SAN which we have been using for testing. We have been exploring ways to get all our servers migrated, but the sticking point is the storage. We can host 5 of our 20 servers on the hyper-v storage but then we would run out of space. Is it feasible to migrate these 5 servers, then delete the LUNs from the VMware storage, recreate and attach to hyper-v and use to store more of the migrated devices? Is this a sensible approach, or is there a much simpler way that we've missed. For info, we are a high school, and don't have the finance to purchase more storage. We do have an education version of System Centre if this would make the process any simpler. We also run Veeam essentials for replication and backup, but its only currently licences for the VMware hosts. Any help/advice/pointers would be appreciated.
Viewing all 19461 articles
Browse latest View live




Latest Images