Skip to content

EC2 MachineName and Tags are blank when creating spot instances

We are creating spot instances for gitrunners, based on the gitlab documentation found here:

https://docs.gitlab.com/runner/configuration/runner_autoscale_aws/

We have it running and it is great. When we went to add the "spot instance" parameters, so that it would save money, the instances failed to create. We found this issue #109 (closed) and subsequently upgraded to the latest version (v0.16.2-gitlab.21j). Now the spot instances are starting up just fine.

However, the name and tags are getting left blank.

Here are the parameters we are currently using:

MachineDriver = "amazonec2"
    MachineName = "gitlab-docker-machine-%s"
    MachineOptions = [
      "amazonec2-access-key=XXX",
      "amazonec2-secret-key=XXX",
      "amazonec2-region=us-east-1",
      "amazonec2-vpc-id=vpc-XXX",
      "amazonec2-subnet-id=subnet-XXX",
      "amazonec2-use-private-address=true",
      "amazonec2-tags=runner-manager-name,gitlab-aws-autoscaler,gitlab,true,gitlab-runner-autoscale,true",
      "amazonec2-security-group=gitrunner-docker",
      "amazonec2-instance-type=t3.large",
      "amazonec2-zone=c",
      "amazonec2-request-spot-instance=true",
]

Here is a screenshot of the ec2 instances we have creatd, which have no name or tags:

image

When we remove the spot instance parameter, the names and tags get setup as expected.

Edited by Clay Lehman