System Center Virtual Machine Manager Service Unable to start - azure-virtual-machine

I have install Virtual Machine Manager on windows server 2012 R2 . it installed sucessfuly but the SCVMM service can't be started please check the following log for and the error
when i try to start SCVMM service its endup with the following error
" The System Center Virtual Machine Manager Service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.
"
Log Name: Application
Source: SCVMMService
Date: 11/4/2014 7:58:55 AM
Event ID: 0
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: HC**********
Description:
Service cannot be started. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Microsoft.VirtualManager.Remoting.IndigoSerializableObject.BuildKnownAssemblyTypes(Assembly assembly)
at Microsoft.VirtualManager.Remoting.IndigoSerializableObject.InitializeKnownTypesCache(List`1 assembliesToExamine)
at Microsoft.VirtualManager.Engine.Remoting.IndigoServiceHost.InitializeKnownTypesCache()
at Microsoft.VirtualManager.Engine.VirtualManagerService.TimeStartupMethod(String description, TimedStartupMethod methodToTime)
at Microsoft.VirtualManager.Engine.VirtualManagerService.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="SCVMMService" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2014-11-04T07:58:55.000000000Z" />
<EventRecordID>10656</EventRecordID>
<Channel>Application</Channel>
<Computer>HC-S*********** </Computer>
<Security />
</System>
<EventData>
<Data>Service cannot be started. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Microsoft.VirtualManager.Remoting.IndigoSerializableObject.BuildKnownAssemblyTypes(Assembly assembly)
at Microsoft.VirtualManager.Remoting.IndigoSerializableObject.InitializeKnownTypesCache(List`1 assembliesToExamine)
at Microsoft.VirtualManager.Engine.Remoting.IndigoServiceHost.InitializeKnownTypesCache()
at Microsoft.VirtualManager.Engine.VirtualManagerService.TimeStartupMethod(String description, TimedStartupMethod methodToTime)
at Microsoft.VirtualManager.Engine.VirtualManagerService.OnStart(String[] args)
at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)</Data>
</EventData>
</Event>

Thanks for posting here.
To resolve this issue, review the AD group membership for any circular references and remove them. If the circular reference is not obvious, the script below can list the nested members of a particular group.
NOTE Use Active Directory Users and Computers to determine the top most group of the group causing issues.
dsquery group -name "Group_VMMSSU" | dsget group -members -expand
I hope you have followed these steps before installing SCVMM
High Level Deployment Process:
In AD, create the following accounts and groups, according to your naming convention:
•DOMAIN\scvmmsvc SCVMM Service Account account
•DOMAIN\scvmmadmin SCVMM RunAs account for managing hosts
•DOMAIN\sqlsvc SQL service account
•DOMAIN\SCVMMAdmins SCVMM Administrators security group
Add the “scvmmsvc” and “scvmmadmin” account to the “SCVMMAdmins” global group.
Add the domain user accounts for yourself and your team to the SCVMMAdmins group.
I suggest you to check this link for more details.
http://blogs.technet.com/b/kevinholman/archive/2013/10/18/scvmm-2012-r2-quickstart-deployment-guide.aspx
Girish Prajwal

I had this error and couldn't find an updated answer to the problem.
In my case, I have SCVMM (server AND console) installed on the same machine (i guess this is pretty normal for a first time installation).
I had seen the system working, then I installed all updates offered from Windows Update. After reboot, my service "System Center Virtual Machine Manager" could not start.
Solution was to look in control panel: "Programs and Features". Clicking "installed updates" there was an entry for System Center Console.
This was a rollup 10.
I uninstalled this, now the service is able to start, and I can log on.
Hope this helps someone.

This KB article from Microsoft addresses the issue- https://support.microsoft.com/en-us/kb/3045931
To resolve this issue, complete the update rollup installation by installing the VMM server update package in addition to the console update. Both the VMM server and VMM Admin Console updates must be at compatible version levels. This will typically be the same update rollup level. For example, a VMM Admin Console should be at the VMM UR5 level if the server is also at UR5.  
In some instances, there may not be a comparable update for a component. In that case, the component should be updated to the most recent applicable update. For example, if the VMM server is updated to a post-UR5 hotfix, but there is no corresponding hotfix for the VMM Admin Console, the VMM Admin Console should be updated to UR5.
In my case update rollup 11 was the cause for the break. Going in to Programs and Features -> Installed Updates, I noticed that Update rollup 11 for the admin console had installed successfully but Update rollup 11 for the VMM service had failed.
I manually installed the failed update (in my case http://download.microsoft.com/download/7/5/1/7515E3DB-1B43-4E7F-8774-A877CCEAA96E/kb3184831_vmmserver_amd64.msp) and now VMM service is able to start and stay started.

Related

Windows agents implementation

One creates a Windows agent by calling CreateService with one of the following two parameters: SERVICE_USER_OWN_PROCESS or SERVICE_USER_SHARE_PROCESS. When SERVICE_USER_OWN_PROCESS is used, the agent will start with the next login and it will have a name like < service_name>_< some session ID>. Example of Windows 10 Microsoft agents: MessagingService_ba3d3c, PrintWorkflowUserSvc_ba3d3c or DevicesFlowUserSvc_ba3d3c (call sc query type=userservice to see the active ones) - in this case, the is 0xba3d3c, while the Logon Session is 0xba1a53 (close, but not enough) (seen with Process explorer).
My questions are:
Can I start the agent immediately after installation without logout? It would help with the installer that asks for reboot now.
What is this mysterious "session ID" ? It would help with the testing, to avoid enumeration and guessing.

wso2 esb and cep installation simultaneouslly

I am trying to install and run ESB and CEP both on the same machine. I have tried to set port offset to 1, to prevent port conflict, but still after running ESB, I am not able to run CEP. The error log in cmd is as bellow:
`C:\Program Files\yajsw-stable-11.03_cep\bat>call setenv.bat
"java" -Xmx30m -Djna_tmpdir="C:\Program Files\yajsw-stable-11.03_cep\bat\/../tmp
" -jar "C:\Program Files\yajsw-stable-11.03_cep\bat\/../wrapper.jar" -t "C:\Program Files\yajsw-stable-11.03_cep\bat\/../conf/wrapper.conf"
YAJSW: yajsw-stable-11.03
OS : Windows 7/6.1/amd64
JVM : Oracle Corporation/1.7.0_75
Dec 20, 2015 11:44:31 AM org.apache.commons.vfs2.VfsLog info
INFO: Using "C:\Users\K5563~1.KHA\AppData\Local\Temp\vfs_cache" as temporary files store.
platform null
************* STARTING "WSO2CARBON_cep" ***********************
Service "WSO2CARBON_cep" NOT started
Press any key to continue . . .`
First : where and how can I find a proper log to figure out what is the problem? As you know, there is nothing in : repository\logs until the program starts to run.
Second : if you have any idea about the probable cause, please let me know.
Additional info : I am using jdk 1.7.0_75, esb 4.9.0, cep 4.0.0, yajsw 11.03, and there was a success message after installation of both esb and cep. I gave them different service names while installing as a windows service, to prevent conflict. Also, I am able to see both of them in windows services list.
Thanks for reading.
To start two carbon servers as windows services please follow the blog post below[1] to overcome this issue. The blog explains how two services can be run as windows services.
Some important areas to consider when setting up two nodes as windows services are :
1.create two folders as 'esb_service' and 'cep_service' and copy the relevant packs into each foldr
2.As shown on[1] please update the esb_home and cep_home on the relevant places within the wrapper.conf replacing the carbon_home which is the default value
3.Make sure that the port offset of one of the two nodes is incremented by one to avoid port conflict.
4.start the two yajsw-stable-11.03 with installService.bat and startService.bat to get the services running
Note: I have tried this scenario using yajsw-stable-11.03 version.
[1]http://blog.lasindu.com/2015/05/how-to-start-two-or-more-wso2-servers.html

Amazon EC2 custom AMI not running bootstrap (user-data)

I have encountered an issue when creating custom AMIs (images) on EC2 instances. If I start up a Windows default 2012 server instance with a custom bootstrap/user-data script such as;
<powershell>
PowerShell "(New-Object System.Net.WebClient).DownloadFile('http://download.microsoft.com/download/3/2/2/3224B87F-CFA0-4E70-BDA3-3DE650EFEBA5/vcredist_x64.exe','C:\vcredist_x64.exe')"
</powershell>
It will work as intended and go to the URL and download the file, and store it on the C: Drive.
But if I setup a Windows Server Instance, then create a image from it, and store it as a Custom AMI, then deploy it with the exact same custom user-data script it will not work. But if I go to the instance url (http://169.254.169.254/latest/user-data) it will show the script has imported successfully but has not been executed.
After checking the error logs I have noticed this on a regular occasion:
Failed to fetch instance metadata http://169.254.169.254/latest/user-data with exception The remote server returned an error: (404) Not Found.
Update 4/15/2017: For EC2Launch and Windows Server 2016 AMIs
Per AWS documentation for EC2Launch, Windows Server 2016 users can continue using the persist tags introduced in EC2Config 2.1.10:
For EC2Config version 2.1.10 and later, or for EC2Launch, you can use
true in the user data to enable the plug-in after
user data execution.
User data example:
<powershell>
insert script here
</powershell>
<persist>true</persist>
For subsequent boots:
Windows Server 2016 users must additionally enable configure and enable EC2Launch instead of EC2Config. EC2Config was deprecated on Windows Server 2016 AMIs in favor of EC2Launch.
Run the following powershell to schedule a Windows Task that will run the user data on next boot:
C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1 –Schedule
By design, this task is disabled after it is run for the first time. However, using the persist tag causes Invoke-UserData to schedule a separate task via Register-FunctionScheduler, to persist your user data on subsequent boots. You can see this for yourself at C:\ProgramData\Amazon\EC2-Windows\Launch\Module\Scripts\Invoke-Userdata.ps1.
Further troubleshooting:
If you're having additional issues with your user data scripts, you can find the user data execution logs at C:\ProgramData\Amazon\EC2-Windows\Launch\Log\UserdataExecution.log for instances sourced from the WS 2016 base AMI.
Original Answer: For EC2Config and older versions of Windows Server
User data execution is automatically disabled after the initial boot. When you created your image, it is probable that execution had already been disabled. This is configurable manually within C:\Program Files\Amazon\Ec2ConfigService\Settings\Config.xml.
The documentation for "Configuring a Windows Instance Using the EC2Config Service" suggests several options:
Programmatically create a scheduled task to run at system start using schtasks.exe /Create, and point the scheduled task to the user data script (or another script) at C:\Program Files\Amazon\Ec2ConfigServer\Scripts\UserScript.ps1.
Programmatically enable the user data plug-in in Config.xml.
Example, from the documentation:
<powershell>
$EC2SettingsFile="C:\Program Files\Amazon\Ec2ConfigService\Settings\Config.xml"
$xml = [xml](get-content $EC2SettingsFile)
$xmlElement = $xml.get_DocumentElement()
$xmlElementToModify = $xmlElement.Plugins
foreach ($element in $xmlElementToModify.Plugin)
{
if ($element.name -eq "Ec2SetPassword")
{
$element.State="Enabled"
}
elseif ($element.name -eq "Ec2HandleUserData")
{
$element.State="Enabled"
}
}
$xml.Save($EC2SettingsFile)
</powershell>
Starting with EC2Config version 2.1.10, you can use <persist>true</persist> to enable the plug-in after user data execution.
Example, from the documentation:
<powershell>
insert script here
</powershell>
<persist>true</persist>
Another solution that worked for me is to run Sysprep with EC2Launch.
The issue is that AWS doesn't reestablish the route to the profile service (169.254.169.254) in your custom AMI. See response by SanjitPatel in this post. So when I tried to use my custom AMI to create spot requests, my new instances were failing to find user data.
Shutting down with Sysprep, essentially forces AWS re-do all setup work on the instance, as if it were run for the first time. So when you create your instance, shut it down with Sysprep and then create your custom AMI, AWS will setup the profile service route correctly for the new instances and execute your user data. This also avoids manually changing Windows Tasks and executing user data on subsequent boots, as persist tag does.
Here is a quick step-by-step:
Create an instance using one of the AWS Windows AMIs (Windows Server 2016 Nano Server doesn't support Sysprep) and passing your desired user data (this may be optional, but good to make sure AWS wires setup scripts correctly to handle user data).
Customize your instance as needed.
Shut down your instance with Sysprep. Just open EC2LaunchSettings application and click "Shutdown with Sysprep". Full instructions here.
Create your custom AMI from the instance you just shut down.
Use your custom AMI to create other instances, passing user data on instance creation. User data will be executed on instance launch. In my case, I used Spot Request screen, which had a User Data text box.
Hope this helps!
At the end of initial bootstrap (UserData) script, just append persist tag as shown below.
Works perfectly.
<powershell>
insert script here
</powershell>
<persist>true</persist>
For those people that got here from Google and are running a Server 2016 instance, it seems that this is no longer possible.
Server2016 doesn't have ec2config service and so you can't use the persist flag.
<persist>true</persist>
Described in Anthony Neace's post.
Server 2016 uses EC2Launch and I haven't yet seen how it's possible to run a script at every boot. You can run a script on the first boot, but subsequent boots will not run it.
I added below powershell script to run during the AMI bake process which helped me fix this issue. This was Windows server 2019.
$EC2LaunchInitInstance = "C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\InitializeInstance.ps1"
$EC2LaunchSysprep = "C:\ProgramData\Amazon\EC2-Windows\Launch\Scripts\SysprepInstance.ps1"
Invoke-Expression -Command "$EC2LaunchInitInstance -Schedule"
Invoke-Expression -Command "$EC2LaunchSysprep -NoShutdown"

How to determine if application/application container has started on AWS elastic beanstalk?

I am writing a generic application deployment tool. It takes an application from the user and deploys it to Elastic Beanstalk. That part is working. The issue is that the users want to compose the use of the deployment tool with other operations, and right now my tool reports success when it has told the Beanstalk APIs to start the application.
Unfortunately, it is thus returning before the application itself has started. So the user is forced to write polling logic themselves to await the starting of their application.
Looking at the AWS Elastic Beanstalk API and I cannot see any methods that return any indication of such a state reporting. The closest I can find is DescribeEvents... which looks hopeful, however it seems from the examples that the granularity of the application / application container starting within the environment is not part of that API:
<DescribeEventsResponse xmlns="https://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
<DescribeEventsResult>
<Events>
<member>
<Message>Successfully completed createEnvironment activity.</Message>
<EventDate>2010-11-17T20:25:35.191Z</EventDate>
<VersionLabel>New Version</VersionLabel>
<RequestId>bb01fa74-f287-11df-8a78-9f77047e0d0c</RequestId>
<ApplicationName>SampleApp</ApplicationName>
<EnvironmentName>SampleAppVersion</EnvironmentName>
<Severity>INFO</Severity>
</member>
Note: the INFO level event is that the environment was created, nothing at the lower level of the application container starting within the environment appears to be reported...
I could mandate that the applications deployed with this tool expose a status REST endpoint, but that puts restrictions on the application.
Is there some API that I am missing that will report when the application container (e.g. Tomcat, Node, etc) is started... or better yet when the application deployed within the container is started... but I can live with the application container
Every application is supposed to expose a health URL (Beanstalk/ELB will have problems any case otherwise - it will think the instances are not responding, and might replace). This is typically a HEAD request expecting a 200 OK.
Since this is anyway expected to be there in all apps, you can probably hit this URL and check the deployment is OK. I guess Beanstalk console itself is using this method.
You can also poll using DescribeEnvironments API call which will give you the Environment CNAME (the URL to check), Health of the environment (RED, GREEN), Status (Launching | Updating | Ready | Terminating | Terminated). This API takes Environment Name as an argument. So you can just get the description of one environment.
API Documentation: http://docs.aws.amazon.com/elasticbeanstalk/latest/APIReference/API_DescribeEnvironments.html
Explanation of Environment Description in response: http://docs.aws.amazon.com/elasticbeanstalk/latest/APIReference/API_EnvironmentDescription.html
Sample Response Below:
<DescribeEnvironmentsResponse xmlns="https://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
<DescribeEnvironmentsResult>
<Environments>
<member>
<VersionLabel>Version1</VersionLabel>
<Status>Available</Status>
<ApplicationName>SampleApp</ApplicationName>
<EndpointURL>elasticbeanstalk-SampleApp-1394386994.us-east-1.elb.amazonaws.com</EndpointURL>
<CNAME>SampleApp-jxb293wg7n.elasticbeanstalk.amazonaws.com</CNAME>
<Health>Green</Health>
<EnvironmentId>e-icsgecu3wf</EnvironmentId>
<DateUpdated>2010-11-17T04:01:40.668Z</DateUpdated>
<SolutionStackName>32bit Amazon Linux running Tomcat 7</SolutionStackName>
<Description>EnvDescrip</Description>
<EnvironmentName>SampleApp</EnvironmentName>
<DateCreated>2010-11-17T03:59:33.520Z</DateCreated>
</member>
</Environments>
</DescribeEnvironmentsResult>
<ResponseMetadata>
<RequestId>44790c68-f260-11df-8a78-9f77047e0d0c</RequestId>
In your case you may want to read following documentation:
Monitoring Application Health
You can also configure Application Health Check URL for your environment. By default AWS Elastic Beanstalk uses TCP:80 check on your instances. But using the Application Health Check URL you can override this health check to use HTTP:80 by using the Application Health Check URL option as described here.
Using Status/Health from DescribeEnvironments you can check if the application has been deployed.

Build never starts on TFS2012

I'm attempting to set up some build controllers and agents in our TFS infrastructure. Our TFS server is setup as a build controller, and I have a few build agents set up as well.
When I queue a new build on my system, all appears to be well. No error messages appear, and the build appears in the queue on my system. However, that's all that ever happens. When I go to the page for the build in Visual Studio, it states it's been "Running for 0 seconds". Looking at the admin console on our TFS server, the controller states it's "Ready", but nothing more. All the agents are similarly listed as 'Ready'.
I'm not aware of any logs I can use to diagnose this issue. I've set the Logging Verbosity to 'Diagnostic', but options in the Diagnostics dropdown are greyed out. The activity is completely blank, as well.
Looking in the database on the build controller, the dbo.tbl_BuildController table does list the build. What I find odd, though, is the StartTime is NULL. If I stop the build in VS, the start time and the end time are set to the same thing in the database.
So, I know that the build is registering with the build controller, and that there's not a communication issue; the build just never starts, and never give an error. How can I resolve this? (or, at least get an error that I can chase down).
EDIT: The issue appears to be related to the TFS server. Here's what I uncovered in the event log:
WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/10411892
Exception: System.ServiceModel.ServiceActivationException: The service '/tfs/queue/GPA/Services/v4.0/MessageQueueService2.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item. ---> System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item
at System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item)
at System.Collections.Generic.SynchronizedCollection1.Add(T item)
at System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
--- End of inner exception stack trace ---
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
Process Name: w3wp
Process ID: 3756
I would start looking in the Event Log.
Control Panel -> Administrative Tools
Event Viewer
I am assuming that there will be some sort or error appearing in there. If your build agents are on a different machine, make sure you look in the event log there too.
Update from original posters comments
There was an exception in the Event Log which pointed us to here: TFS2012 Build Service offline
Go check the security settings of the user that is used for the build service properties. I've had almost the same issue and it was because I changed some security settings for that specific user where he suddenly could not build anymore.
To find the user:
Go to your TFS server
Open Team Foundation Server Administration Console
Open Build Configuration
Open Properties of the Build Service
This worked for me, password of the user account which was used to access TFS hosted on different Server expired.
Password reset fixed it for me.
The build controller and agent must run the same version of Team Foundation Build.
(Buid Service version is something like v4.0 or v4.1 and it is different from tfs product version which is some thing like 11.0.50727.1)
So, if the build Agent and controller are deployed in different machines, check the build service version on both machines. it must be the same.
TFS prevents to assign a build agent to a build controller with different build service version. However, you are allowed to upgrade one of the build machines to a different version (for example visual studio update 2) without detaching the controller and agent
in some cases the build service version stay unchanged (for example inspite of upgrading to update 2 the version stay v4.0)
in this situation if you want to apply the new version of build service
in tfs 2012 or 2013 to check the build service version:
Go to Build Machine
Open Team Foundation Server Administration Console
Open Build Configuration
Open Build Service properties (click on the properties link next to the unregister
link)
"Listen for build agent communication on" text box
to apply change of the build service version
stop the service
Click the "Change" button
set a different port number
reset the previous port number
immediately the build service version will change from v4.0 to v4.1