keithvassallomt / parsec-aws-automation

Some utility scripts for making rolling your own cloud gaming server with Parsec on AWS easier, particularly with automation
MIT License
169 stars 26 forks source link

Can't create new instance from Script #9

Closed rendez2k closed 2 years ago

rendez2k commented 3 years ago

Hi there! Great tutorial. The one issue I have is with the start script, on Windows. I get

"Launching new instance with AMI id:

usage: aws [options] [ ...] [parameters] To see help text, you can run:

aws help aws help aws help

aws.exe: error: argument --image-id: expected one argument"

The AMI is missing. In the video you say not to specify an AMI - is that the issue?

keithvassallomt commented 3 years ago

Make sure that GAMING_INSTANCE_NAME is set correctly in the script. Also make sure that your AMI is tagged with a tag called Name and a value set to the same thing you set GAMING_INSTANCE_NAME to.

rendez2k commented 3 years ago

Thank you! So re-did it all carefully, I think it was the tag.

But now I'm getting: Launching new instance with AMI id: ami-008aeceef34537aa2 aws : At C:\Users\rende\Desktop\RobinBoxV2\RobinBoxV2.ps1:7 char:1

An error occurred (MaxSpotInstanceCountExceeded) when calling the RunInstances operation: Max spot instance count exceeded

keithvassallomt commented 3 years ago

You need to request an increase to the number of spot instances you can create: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-limits.html#spot-vcpu-limits-request-increase

rendez2k commented 3 years ago

Thank you for your help! Amazon came back this as an FYI for new users: "For this limit increase, I will need to reach out to our service team. Please be advised that it will take some time for them to review your request.

Furthermore, some advice, your account is quite new, I would suggest that in the meantime you utilize the current resources available, as this would count in your favor, as account usage history is taken into consideration with these kind of requests."

So I just removed it from the settings.

All working and I had a quick game of Fortnite. I need to optimise my settings somewhere as there was some very noticeable stutters and pauses: the FPS counter would ping from 120 down to around 40 during new areas or fast movements such as jumping out of the bus. As the FPS counter is part of the game, I would guess the settings or AWS instance is struggling rather than the Parsec feed? 80-90% of the time it was locked at 120FPS though.

I also noticed you were using gp3 volumes so not sure if that makes a difference to speed?

keithvassallomt commented 3 years ago

I also noticed you were using gp3 volumes so not sure if that makes a difference to speed?

Yes - most probably the problem with new areas is assets loading from the gp2 volumes (especially right after restoring from a snapshot). Also, on a g4dn.xlarge, the bottleneck is the CPU, not the GPU.

rendez2k commented 3 years ago

I went for 4dn.2xlarge but its not clear (to me anyway!) what that gives me?

Can I just change the launch template to gp3?

keithvassallomt commented 3 years ago

I went for 4dn.2xlarge but its not clear (to me anyway!) what that gives me?

https://aws.amazon.com/ec2/instance-types/

Can I just change the launch template to gp3?

Yes. But after launching the instance, shut it down, wait for the snapshot, and then launch it again. That way it will restore from the GP3 and be faster.

keithvassallomt commented 2 years ago

hey i'm having a problem when i started the script, it says :

An error occurred (InvalidParameterDependency) when calling the RunInstances operation: The parameter KmsKeyId requires the parameter Encrypted to be set.

and i don't know what it means, can somebody help me?

You have selected to encrypt your EBS volume when creating the instance, which you really don't need to do for this use case. So, either re-create the instance without an encrypted volume, or specify the Encrypted parameter to true. See here for the documentation.