Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Gives me a headache.

I have a ton of differential discs. In order to move the machiens around - and because (Thank heaven) vm move does NOT copy the sources of differential discs (sadly export does), my idea is to have a central copy of all the Masters on every Hyper-V computer.

Example: VM X has a vhdx named "System.vhdx" and that is differential from ...\masters\x64-2012std.vhdx"

To standardize the paths of the differential discs, I would like them to be in c:\Hyper-V\Masters....

Now, C does not always have enough space, so my idea was that \Masters\ in there is a junction to the real path.

Works, EXCEPT:

PowerShell set-vhd ......\system.vhdx -ParentPath c:\Hyper-V\Master.....goeson.vhdx

works, the VM starts, BUT...


leaves me do see that the vhdx is directly linked to the file - somehow Hyper-V found it nice to RESOLVE the junction and replace it with the "real" path of the file.

Which totally breaks when I move the VM to another host that has a diffrent disc layout (and we have currently planned 3 ones).

Now, is there any way to work around that? I would like the ParentPath to be the ParentPath AS I HAVE SET IT, not something changed, or to get an error.

share|improve this question

PowerShell runs in an entirely different user context, and sometimes on an entirely different machine from Hyper-V itself. So any file path used within it must be fully expanded to be meaningful. For relative paths, there's simply no good answer to the question "relative to what" because file path expansions can be user-context specific.

I do understand, however, that your strategy has an answer to that question, but most of them don't. And the path expansion code is just using the underlying .net path expansion, which apparently expands reparse points.

You might try talking directly to the WMI layer, rather than using the PowerShell cmdlets. You can find a bunch of examples on Ben Armstrong's "Virtual PC Guy" blog.

share|improve this answer
Not sure whether this is an answer, but yeah - that could work. Funny is that if you mount a partition for example on C:\Masters then it turns into a \\blabla\volume\\guid\ path - basically needs the same partition. That stops being helpfull at all. Those reparse points should stay. I will check WMI. – TomTom Jan 9 '13 at 9:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.