Verifying password reset agent operation on a Windows Server VM
Checking that the agent is installed
-
Make sure that the agent is installed and running as the
yc-guest-agent
service:PowerShellGet-Service "yc-guest-agent"
-
If the agent is installed and running, it will show up on the list as
Running
:Status Name DisplayName ------ ---- ----------- Running yc-guest-agent yc-guest-agent
-
If the agent is installed but is not running, it will show up on the list as
Stopped
. To run the agent, use the command below:Start-Service "yc-guest-agent"
Afterwards, check again that the agent is running.
-
If the agent is not installed, it will not show up. Follow the instructions to install it.
-
Verifying agent updates
-
Make sure that the agent update is configured and running properly:
PowerShell-
Make sure that the agent update job is running:
Get-ScheduledTask "yc-guest-agent-updater" -OutVariable Task
Result:
TaskPath TaskName State -------- -------- ----- \ yc-guest-agent-updater Ready
The
yc-guest-agent-updater
job must have theReady
status. -
Get information about the most recent job run.
$Task | Get-ScheduledTaskInfo
Result:
LastRunTime : 3/15/2023 2:39:39 PM LastTaskResult : 2147946720 NextRunTime : 3/20/2023 6:36:36 AM 12:10:10 AM NumberOfMissedRuns : 0 TaskName : yc-guest-agent-updater TaskPath : \ PSComputerName :
If the most recent update was successful, the value in the
LastTaskResult
field will be0
.
-
Retrieving agent logs
You can retrieve password reset agent logs on serial port 4 (COM4) or directly from the agent in PowerShell.
To get logs:
- Select the folder the VM belongs to.
- Select Compute Cloud.
- Click the required VM row.
- Go to the Serial port tab.
- Select COM4 as your port.
- To use the CTRL + F keyboard shortcut to search, enable Raw mode in the upper-right corner.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
Run the following command:
yc compute instance get-serial-port-output <VM_name> --port 4 > output.txt
The logs will be saved to a file named output.txt
.
-
Stop the agent:
Stop-Service "yc-guest-agent"
-
Restart the agent with the required logging level as specified in the
--log-level
parameter. For example:& "C:\Program Files\Yandex.Cloud\Guest Agent\guest-agent.exe" start --log-level debug
To get the serial port output, use the getSerialPortOutput REST API method for the Instance resource or the InstanceService/GetSerialPortOutput gRPC API call. Set the port
field to 4
.