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?

已提問 2 年前檢視次數 229 次
1 個回答
1
已接受的答案

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
已回答 2 年前
profile pictureAWS
專家
Toni_S
已審閱 2 年前
  • 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.

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南