NEsted Virtualization not working on Azure VM - azure

I'm trying to start a nested VM on Windows2016 VM deployed on azure ( Size used allows Nested Virtualization ) and after all guides followed I'm not sure what i could be missing since i Do have Hyper V installed:
Role manager:
Services:
Error when i try to start the VM:
Start-VM : 'sfm-azure-01' failed to start.
Failed to start the virtual machine 'sfm-azure-01' because one of the Hyper-V components is not running.
'sfm-azure-01' failed to start. (Virtual machine ID BA61E565-9B2B-4180-B79D-FD3F16882314)
The Virtual Machine Management Service failed to start the virtual machine 'sfm-azure-01' because one of the Hyper-V components is
not running (Virtual machine ID BA61E565-9B2B-4180-B79D-FD3F16882314).
At line:1 char:1
+ Start-VM -Name sfm-azure-01
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Start-VM], VirtualizationException
+ FullyQualifiedErrorId : OperationFailed,Microsoft.HyperV.PowerShell.Commands.StartVM
References used: https://learn.microsoft.com/azure/virtual-machines/windows/nested-virtualization

Did you try this script for enabling nest virtualisation.
It looks like it checks all the prerequisites.
https://github.com/charlieding/Virtualization-Documentation/tree/live/hyperv-tools/Nested

Related

"An error occurred while creating the pipeline." when running powershell script in Azure pipeline self-hosted agent

When I run simple powershell with only ls command in it through Azure pipeline self-hosted agent I see error:
An error occurred while creating the pipeline.
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : RuntimeException
The same script runs fine locally in the same folder on the same machine (when no Azure agent is involved). The pipeline has not been changed in months.
The execution policy is set to "Unrestricted".
There is no difference whether the agent is run with admin permissions.
I checked and the files in the folders of the agent do not look blocked or read-only.
We run tests through powershell scripts and they started to fail last week, without any obvious reason. The only thing that I have installed on the same machine, is Visual Studio 2022 Preview 5, but I have restarted the machine immediately after the installation has passed successfully and the next day the tests have passed.
I had a look through similar errors here, in stackoverflow, but they were not useful, including this one PowerShell "an error occurred while creating the pipeline" #Requires -Version 3.0
Do you have an idea what can cause this?
The PowerShell scripts started passing when I changed the Azure Powershell pipeline task version from 1* to 2* (the latest available for our pipelines).
I do not know why this fixed the issue, as I think the difference between these 2 version is that version 2* can be executed on agents that have operating system that is not Windows.

Error: Unable to get the remote environment variable 'WindowsDirectory' using msdeploy tempagent

When using msdeploy to deploy an IIS app to a remote server, using the Web Deploy On Demand (tempagent) feature, I am getting this error:
./myApp.deploy.cmd : Error: Unable to get the remote environment variable 'WindowsDirectory' on the computer
'myserver.mydomain.com'.
At line:1 char:1
+ ./myApp.deploy.cmd /T /M:$target /U:$username /P:$ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Error: Unable t...com'.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Error: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))
Error count: 1.
I'm using the auto-generated deploy script that gets created by the Package target in msbuild. I'm running in the directory that all those artifacts live. This is my script to run that script:
$target = 'myserver.mydomain.com'
$username = 'myusername'
$password = 'mypassword'
./myApp.deploy.cmd /T /M:$target /U:$username /P:$password /G:true
This is the script that is generated by the .cmd script, the same exact error happens if i run it directly:
SetParameters from:
"C:\Users\MaxCadmin\Desktop\Package\myApp.SetParameters.xml"
You can change IIS Application Name, Physical path, connectionString
or other deploy parameters in the above file.
-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:package='C:\Users\MaxCadmin\Desktop\Package\myApp.zip' -dest:auto,computerName="myserver.mydomain.com",userName="myusername",password="mypassword",includeAcls="False",tempAgent="true" -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\Users\MaxCadmin\Desktop\Package\myApp.SetParameters.xml" -whatif
Info: Using ID 'bce210a0-29f9-4859-8fc2-f308c6ce5e72' for connections to the remote server.
I'm using the tempagent feature so that I don't have to go install Web Deploy on all my targets, and keep them all updated to the same version. I much prefer the prospect of using the Temp Agent, removing the need for any special configuration of the targets at all. I've confirmed that my target in this case does not have Web Deploy installed on it.
I believe it's the Temp Agent that is throwing the disconnect error at the end of the error message. I'm more concerned about the error regarding the inability to get the remote variable.
For what it's worth, I went on the remote server and created that env variable, with the value matching
that of windir, which is C:\Windows, and proved to myself that it was present in a new shell. But it didn't change the error at all.

Service Fabric Start-ServiceFabricClusterConfigurationUpgrade constantly times out

I have a Service Fabric standalone cluster where I can connect to it with Connect-ServiceFabricCluster just fine, but whenever I run other commands such as Start-ServiceFabricClusterConfigurationUpgrade, it keeps timing out. I've tried running commands with longer timeouts (as long as 10 min) with the same results. Any ideas what I might be doing wrong?
This works..
PS C:\WINDOWS\system32> Connect-ServiceFabricCluster -ConnectionEndpoint "localhost:19000"
True
ConnectionEndpoint : {localhost:19000}
...
But these commands time out...
PS C:\WINDOWS\system32> Get-ServiceFabricClusterConfiguration -TimeoutSec 300
Get-ServiceFabricClusterConfiguration : Operation timed out.
At line:1 char:1
+ Get-ServiceFabricClusterConfiguration -TimeoutSec 300
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationTimeout: (Microsoft.Servi...usterConnection:ClusterConnection) [Get-ServiceFabr
icClusterConfiguration], TimeoutException
+ FullyQualifiedErrorId : GetClusterConfigurationErrorId,Microsoft.ServiceFabric.Powershell.GetClusterConfiguratio
n
Start-ServiceFabricClusterConfigurationUpgrade -ClusterConfigPath ClusterConfig.Unsecure.DevCluster.v2.json
Start-ServiceFabricClusterConfigurationUpgrade : Operation timed out.
At line:1 char:1
+ Start-ServiceFabricClusterConfigurationUpgrade -ClusterConfigPath Clu ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationTimeout: (Microsoft.Servi...usterConnection:ClusterConnection) [Start-ServiceFa
...gurationUpgrade], TimeoutException
+ FullyQualifiedErrorId : StartClusterConfigurationUpgradeErrorId,Microsoft.ServiceFabric.Powershell.StartClusterC
onfigurationUpgrade
I believe this a single node dev cluster? If so, it can't be upgraded and needs to be recreated instead.
You can upgrade your cluster to the new version only if you're using a
production-style node configuration, where each Service Fabric node is
allocated on a separate physical or virtual machine. If you have a
development cluster, where more than one Service Fabric node is on a
single physical or virtual machine, you must re-create the cluster
with the new version.
To fix:
Create backups for all desired service partitions.
Update the client tooling using the web platform installer.
Remove the old cluster and recreate it using the Local Cluster Manager tool (in the tray, if on Windows).
Redeploy applications.
Restore service backups.

How to start a BITS download as System Account? current error: "user has not logged on to the network" 0x800704DD

I'm trying to launch a BITS service download in a GPO Startup Script. Startup Scripts are started as the local SYSTEM account, which works well for background downloads as per Microsoft's documentation https://msdn.microsoft.com/en-us/library/windows/desktop/aa363152(v=vs.85).aspx
Sadly when I try to start a download (disregarding valid source or destination) I get the following error:
Start-BitsTransfer : The operation being requested was not performed because
the user has not logged on to the network. The specified service does not
exist. (Exception from HRESULT: 0x800704DD)
At line:1 char:1
+ Start-BitsTransfer -Source localhost -Destination c:\temp
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Start-BitsTransfer], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.BackgroundIntelligentTransfer.Management.NewBitsTransferCommand
This is just a test, the actual BITS transfer is started within a c# application that is launched within the GPO Startup Script. Further tests with a manually created process through Sysinternals PSExec yield the same error.
Additional checks for security principals in whoami /all look fine:
User Name SID
=================== ========
nt authority\system S-1-5-18
GROUP INFORMATION
-----------------
...
CONSOLE LOGON Well-known group S-1-2-1
...
LOCAL Well-known group S-1-2-0
BUILTIN\Administrators Alias S-1-5-32-544
I checked for services BITS and SENS - all running.
To summarize:
How can i successfully launch a BITS download as SYSTEM in Startup Script?
How does the error "user has not logged on to the network" make sense, considering System account is always logged on? What is the meaning of "The specified service does not exist." - what service?

Desktop App Converter "Fatal Error 1000"

I receive the following error when attempting to run the Desktop App Converter (Project Centennial):
Assert-RequiredFeatureEnabled: fatal error 1000: required feature is not installed or enabled. Please refer to machine setup instructions.
At C:\Users\%%%\Documents\DesktopAppConverter\converter_util\EnvironmentAssertions.ps1:40 char:9
+ throw "Assert-RequiredFeatureEnabled: fatal error 1000: requi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Assert-Required...p instructions.:String) [], RuntimeException
+ FullyQualifiedErrorId : Assert-RequiredFeatureEnabled: fatal error 1000: required feature is not installed or enabled. Please refer to
machine setup instructions.
The relevant script is in EnvironmentAssertions.ps1:
$feature = Get-WindowsOptionalFeature -Online -FeatureName "Containers"
if (!$feature) {
throw "Assert-RequiredFeatureEnabled: fatal error 1000: required feature is not installed or enabled. Please refer to machine setup instructions."
}
I found no items in Windows Features that appear related to containers.
How can this error be resolved?
Windows 10 Pro insider preview (build 14316) and Desktop App Converter preview (0.1.8.release_2016-04-05_17-47_5aa8cc)
After looking around, it appears that the "Containers" feature is only on Enterprise versions of Windows 10 at the moment - perhaps they will extend this to Pro eventually, but I think that's why we can't get it working.

Resources