Forum Discussion
Convert UPD to FSLogix container
- Oct 29, 2019
Roger Critz we will be starting a private preview for a PowerShell script to accomplish this. I will post the specifics here when available. The Private Preview will be for those moving from on-prem to WVD, which is the use case you describe. The current plan is for this PowerShell to ultimately move to an open source repo to be extended by the community. Thanks!
OK so here is what I have so far. It's actually functional and I think anyone can run it in their environment.
It will get the list of files for X:\Path\UVHD-<SID>.vhdx and then give you X:\Path\SAM_SID\Profile_SAM.vhdx
It takes about 11 seconds per VHDX file. There's a 5-second delay on the mount and dismount step just to make sure that process has completed before moving onto the next file.
There's one problem in my environment but it's not the code itself. About 1 in 20 source VHDX files fail to mount. e.g. Mount-Diskimage -ImagePath X:\Path\to\the\file.vhdx. The error is 0x80070005.
I've tried on multiple servers and accounts. It's not NTFS permissions or lack of admin rights. I haven't found the cause yet.
If you comment out the part where it does any actual changes and leave only the mount and dismount sections then you can see if you're okay to proceed in your environment. If anyone has any idea why some files fail to mount I'd like to hear. That's the reason I am sharing this now 🙂
Edit: Just as follow up... if anyone wants to quickly see if they'll have Mount-DiskImage issues then you can use the below.
$tests = Get-ChildItem "X:\Path" -File -Filter UVHD-S*.vhdx | Sort Name
New-Item -Path "X:\Path" -ItemType File -Name 'aaaa.txt'
ForEach ($test in $tests){
Write-Host "This is "$test.FullName -ForegroundColor Green
Mount-DiskImage -ImagePath $test.FullName -ErrorAction SilentlyContinue -ErrorVariable MountError | Out-Null;
If ($MountError){
Write-Host "Failed to mount" $test.FullName -ForegroundColor Yellow
Add-Content -Path "X:\Path\aaaa.txt" -Value $test.FullName
}
Dismount-DiskImage -ImagePath $test.FullName | Out-Null
}
I was able to convert my UPD's but when i try to login using FSLogix the login doesnt attach to the new VHDX . Is there something you need to do after to get it to attach properly? adamsi175
- Doug_CoombsDec 06, 2019
Microsoft
jerrywilkinson If FSLogix is configured correctly (enabled, set properly for your format (VHD/VHDX) and not using the profile, then it would be a matter of standard FSLogix trouble shooting to determine the issue. Trouble shooting steps can be found here: https://docs.microsoft.com/fslogix/fslogix-trouble-shooting-ht.
Additional information around error codes, etc. are also available in the reference section.
- jerrywilkinsonDec 06, 2019Copper Contributor
Doug_Coombs yes ive gone through all of that, and our FSLogix settings are correct. the errors im seeing are:
VirtualDiskAPI::CreateFormattedDisk failed to create vhd(x):
LoadProfile failed. User: ndtest. SID: S-1-5-21-4174114073-886831968-143637270-1216. (A device attached to the system is not functioning.)
i think there is an issue in the conversion process, it creates the new VHDX but if i try to mount it with the FSLogix Mount tool i get errors related to permissions. but ive compared the permissions to a new FSLogix container VHDX and they are the same. So just scratching my head on the root issue
- Doug_CoombsDec 06, 2019
Microsoft
jerrywilkinson Sorry if these are remedial questions, but I need to understand the scenario.
1- I assume that the user can manually mount the VHDX, from the same machine as is being used for FSLogix, and traverse?
2- What is the result of the error, a new VHDX, temp profile, local profile, etc?
3- What process did you use to convert?
Thanks!