App Fabric: Method not found: 'System.String Microsoft.ApplicationServer.Caching.Utility.GetInstallPathFromRegistry()' - windows

I am attempting to install App fabric on a Windows Server 2008 R2 VM.
Here are the steps taken:
Created file share accessible to Network Service
Ran WindowsServerAppFabricSetup_x64.exe
Disable Automatic Microsoft Updates
Installed:
Caching Services
Cache Client
Cache Administration
Checked “Set Caching Service Configuration”
Selected XML Provider
Set file share
Use default ports
Installed Hotfix AppFabric1.1-RTM-KB2716015-x64-ENU.exe
Rebooted Server
Started AppFabric Caching Service
But when I run the 'App Fabric Caching Administration PS' as Administrator I get the following error:
Connect-AFCacheClusterConfiguration : Method not found: 'System.String Microsof
t.ApplicationServer.Caching.Utility.GetInstallPathFromRegistry()'.
At line:1 char:100
+ Set-ExecutionPolicy AllSigned Process;Import-Module DistributedCacheAdministr
ation;Use-CacheCluster <<<<
+ CategoryInfo : NotSpecified: (:) [Connect-AFCacheClusterConfigu
ration], MissingMethodException
+ FullyQualifiedErrorId : System.MissingMethodException,Microsoft.Applicat
ionServer.Caching.Commands.ConnectAFCacheClusterConfigurationCommand
PS C:\Windows\system32>
Any suggestions what the issue may be?

Related

Powershell script running over ssh to windows via teamcity

I am getting the following error in my TeamCity pipeline log
An error has occurred which PowerShell cannot handle. A remote session
might have ended. + CategoryInfo : OpenError: (172.31.26.4:String) [],
PSRemotingDataStructureException + FullyQualifiedErrorId :
PSSessionStateBroken
I'm running TeamCity 2018.2.4 (build 61678) which is running on windows 2012 R2 along with a single Agent on the same server. Powershell 6 and OpenSSH installed on both TeamCity and the Windows Server.
I can run the script locally from the Teamcity server via powershell and runs fine with no errors.

Service fabric deployment works from Visual studio, but PS script from output doesn't work in a Powershell window

Same deploy package, same cluster, no security. If I deploy through VS2015 everything goes swimmingly. If I watch the output in VS, I can see what PS script it is executing and with what parameters. If I copy that script to a powershell window (running as admin) and execute it there, I get the below error
WARNING: Unable to Verify connection to Service Fabric cluster.
Test-ServiceFabricClusterConnection : Cluster connection instance is null
At C:\Program Files\Microsoft SDKs\Service
Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:143 char:16
+ [void](Test-ServiceFabricClusterConnection)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [Test-ServiceFabricClusterConnection], NullReferenceException
+ FullyQualifiedErrorId : GetClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.TestClusterConnection
Why would the same script with the same parameters work in VS and not in Powershell?

Unable to share S2D Cluster

I am creating a session farm for UPD's and seem to be at a loss when it comes to creating the share for the cluster. I double check all my steps from this link
https://technet.microsoft.com/en-us/windows-server-docs/compute/remote-desktop-services/rds-storage-spaces-direct-deployment
The very last cmdlet is where it fails when building the share.
PS C:\Windows\system32> New-SmbShare -Name UpdStorage -Path C:\ClusterStorage\Volume1\Data
New-SmbShare : The resources must be online on the same node for this operation
At line:1 char:1
+ New-SmbShare -Name UpdStorage -Path C:\ClusterStorage\Volume1\Data
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (MSFT_SMBShare:ROOT/Microsoft/Windows/SMB/MSFT_SMBShare) [New-SmbShare], CimException
+ FullyQualifiedErrorId : Windows System Error -2147018963,New-SmbShare
When I go to share the folder manually I recieve this error.
The error occured while trying to share Data. The resource must be online on the same node for the operation.
The shared resource was not created at this time.
I have confirmed that both nodes are online, I have attempted this on both nodes to recieve the same error as well. I have added the "SYSTEM" account to full control and inherited all the way down and that has not helped. Anyone have any idea's? This is on a 2016 Server in Azure.
In Failover Cluster Manager, which node is the owner of the CSV? Log on to that node and run the cmdlet there.

Windows container quickstart: Install-ContainerHost.ps1 fails with message "Image NanoServer not found after 5 minutes"

Note: This issue has already been reported on GitHub here without any solution so far.
Platform info: Hyper-V enabled Windows 2016 Server TP4 guest on ESX 6.0 with 6GB of RAM and a 80GB hard-disk.
I followed the "Deploy a Windows Container Host to a New Hyper-V Virtual Machine" quickstart but the process always fails as listed below:
PS C:\Windows\system32> powershell.exe -NoProfile c:\New-ContainerHost.ps1 -VMName testcont -WindowsImage ServerDatacenterCore -Hyperv
cmdlet New-ContainerHost.ps1 na posição de comando 1 do pipeline
Forneça valores para os seguintes parâmetros:
Password: ********
Before installing and using the Windows Server Technical Preview 4 with Containers virtual machine you must:
1. Review the license terms by navigating to this link: http://aka.ms/tp4/containerseula
2. Print and retain a copy of the license terms for your records.
By downloading and using the Windows Server Technical Preview 4 with Containers virtual machine you agree to such license terms. Please confirm you have accepted and agree to the license terms.
[N] No [Y] Yes [?] Ajuda (o padrão é "N"): y
Using VHD path C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks
Using external switch vmxnet3 Ethernet Adapter - Virtual Switch
The latest ServerDatacenterCore VHD is already present on this system.
ServerDatacenterCore Container OS Image (WIM) is already present on this system.
Creating VHD files for VM testcont...
VHD mount must be synchronized with other running instances of this script. Waiting for exclusive access...
Mounting ServerDatacenterCore VHD for offline processing...
Enabling Containers feature on drive F...
Enabling Hyper-V feature on drive F...
Copying Docker into ServerDatacenterCore VHD...
Copying NSSM into ServerDatacenterCore VHD...
This script uses a third party tool: NSSM. For more information, see https://nssm.cc/usage
Downloading NSSM...
Extracting NSSM from archive...
Writing default unattend.xml...
Copying Install-ContainerHost.ps1 into ServerDatacenterCore VHD...
Dismounting VHD...
Creating VM testcont...
Configuring VM testcont...
Connecting VM to switch vmxnet3 Ethernet Adapter - Virtual Switch
AVISO: A virtualização aninhada é um recurso de visualização sem suporte. Os hipervisores que não forem o hipervisor do
Hyper-V em execução em uma máquina virtual convidada provavelmente falharão. Além disso, alguns recursos do Hyper-V
são incompatíveis com a virtualização aninhada, como memória dinâmica, pontos de verificação e salvar/restaurar.
Starting VM testcont...
Waiting for VM testcont to boot...
Connected to VM testcont Heartbeat IC.
Waiting for specialization to complete (this may take a few minutes)...
Executing Install-ContainerHost.ps1 inside the VM...
Completing container install...
Querying status of Windows feature: Containers...
Feature Containers is already enabled.
Querying status of Windows feature: Hyper-V...
Feature Hyper-V is already enabled.
Waiting for Hyper-V Management...
Enabling container networking...
Creating container switch (NAT)...
Creating NAT for 172.16.0.0/24...
Installing Container OS image from D:\WindowsServerCore.wim (this may take a few minutes)...
Container base image install complete. Querying container images...
C:\Install-ContainerHost.ps1 : Image NanoServer not found after 5 minutes
At line:1 char:1
+ C:\Install-ContainerHost.ps1 -PSDirect -NATSubnetPrefix 172.16.0.0/24 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-ContainerHost.ps1
C:\New-ContainerHost.ps1 : Install-ContainerHost.ps1 failed in the VM
No linha:1 caractere:1
+ c:\New-ContainerHost.ps1 -VMName testcont -WindowsImage ServerDatacen ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-ContainerHost.ps1
I'm helpless. Any help would be appreciated.
I just had to get past this issue myself so I can tell you what I had to do...
The issue's with a line in Install-ContainerHost.ps1 which is a file run by New-ContainerHost.ps1
You can get that Install file from here
Inside it there's the following line that needs to be replaced to stop that error occurring:
$newBaseImages = Get-InstalledContainerImage $BaseImageName
That line can be replaced with the line below:
$newBaseImages = Get-ContainerImage
Having done that and saved it (I saved mine alongside New-ContainerHost.ps1 in C:), you can then tell the New-ContainerHost.ps1 file to make use of it by including a -ScriptPath option in the command you're running:
powershell.exe -NoProfile c:\New-ContainerHost.ps1 -VMName testcont -WindowsImage ServerDatacenterCore -Hyperv -ScriptPath C:\Install-ContainerHost.ps1
One other thing to look out for - you may need to temporarily amend your execution policy with Set-ExecutionPolicy or sign that modified ps1 file before Powershell will allow you to run it, depending on what your system's Execution Policy is currently set as.
That was it for me. Hope it helps you.

Can't setup up Windows Server Containers on Windows Server 2016 TP4

I'm trying to setup up Windows Server Containers on Windows Server 2016 TP4.
I'm following the guideline from MS, but it does not work. It always fails with the following error:
Getting Container OS image (WindowsServerCore) version 10.0.10586.0 from OneGet (this may take a few minutes)...
C:\Install-ContainerHost.ps1 : Unable to download.
In Zeile:1 Zeichen:1
+ C:\Install-ContainerHost.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-ContainerHost.ps1
I could find out that the Install-ContainerHost.ps1 script tries to download the WindowsServerCore image from here. Calling this URL manually returns "BlobNotFound".
I am not sure if this is some fault from me or they just have a problem with the server. I have tried to run the script already several times today. Yesterday it worked on another VM..
Edit: Seemed to be a problem from Micrsoft with the download server, which was fixed now.
OK this is what we did go to your ISO for TP4, and open the ISO.
Inside there's a folder for "NanoServer" in which you can find the wim File (image).
Copy this image locally, or where you prefer on the internet. Get the URL, you're going to use it to hack the Powershell script.
Run these commands in Powershell
Install-Package ContainerProvider
Verify the Package has been installed by running:
Find-ContainerImage
Notepad Open: C:\Program Files\WindowsPowerShell\Modules\ContainerProvider\0.5.2\ContainerProvider\ContainerProvider.psm1
Go to line: 508 and modify the Variable $downloadURL: (notice how I used my own url)
$downloadURL = "http://10.0.2.2:8000/NanoServer.wim"
After this: Just run
Install-ContainerImage -Name NanoServer
The image will be installed

Resources