FleetIQ Cannot update Game Server status from UTILIZED to AVAILABLE from CLI and SDK

0

I have set up my AWS account and I am integrating fleetIQ in a sample spring boot java project. I have created a Game Server Group named "TestGameServerGroup" and in my backend code I am listing the game server group. After that I am registering Game Server name "game-server-1" in my sample EC2 spring boot project.

Now when I update the status of the game server "game-server-1" to "UTILIZED" I cannot change it back to "AVAILABLE". I am trying to update it with SDK and CLI both, but none of it works.

The error that I am getting is "An error occurred (InvalidRequestException) when calling the UpdateGameServer operation: Unable to update game server from UTILIZED to AVAILABLE"

Command used to set UTILIZED status "aws gamelift update-game-server --game-server-id game-server-1 --utilization-status UTILIZED --health-check HEALTHY --game-server-group-name TestGameServerGroups"

Command used to set AVAILABLE status which gives InvalidRequestException. "aws gamelift update-game-server --game-server-id game-server-1 --utilization-status AVAILABLE --health-check HEALTHY --game-server-group-name TestGameServerGroups"

Why am I getting this error and can we directly update status to AVAILABLE after setting to UTILIZED? When are we supposed to set these particular statuses? Am I supposed to call any other GameLift FleetIQ API before setting status to AVAILABLE?

asked 2 years ago224 views
1 Answer
1
Accepted Answer

Hi,

This is an expected error. You may not update a game server's utilization status from UTILIZED to AVAILABLE.

This doc has a basic guideline on when to update your game server utilization status, down in "Update game server status": https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-integrate-gameserver.html

In short, your game client will attempt to acquire a game server by calling ClaimGameServer. From there, either the Game Server Group will look for an AVAILABLE Game Server OR the given Game Server must be in AVAILABLE status. If an AVAIlABLE Game Server is found, in 60 seconds either the game client or game server needs to call UpdateGameServer to set that Game Server to UTILIZED.

AWS
answered 2 years ago
profile pictureAWS
EXPERT
Toni_S
reviewed 2 years ago
  • Yes. Basically, when a game session ends we have to deregister that server and register a new server in its place to maintain capacity and utilize the EC2 instance.

    For example, out of 100 total capacity of EC2, 50 are being utilized and 5 are getting deregistered, so the servers available to be claimed are 45. To fully optimize resource usage, we need to register 5 new server in that particular EC2 instance.

    Also need to check the server is not in draining state/getting terminated before creating new servers.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions