Skip to content

GCE deployment failing when non compliant resource name selected #597

Open
@mdallali

Description

@mdallali

I was trying to deploy a sample server in GCE.

I have mistakenly put a non compliant machineName to the VM instance resource I am creating
roughly contains this :

machine =
{
deployment.targetEnv = "gce";

  deployment.gce = {
  project = "foo";
  serviceAccount = "[email protected]";
  accessKey = foo.pem;
  region = "us-east1-b";
  instanceType = "n1-standard-1";
  network = "default";
  machineName = "foo-prod-";
  tags = ["dummy-gce"];
} ;

fileSystems =
[
{ mountPoint = "/data";
autoFormat = true;
fsType = "xfs";
gce.size = 40;
gce.disk_name = "data";
}
}

The deployment failed and logged

$ nixops deploy -d vm-on-gcp
machine1.> creating GCE machine 'foo-prod-'...
error: {u'domain': u'global', u'message': u"Invalid value for field 'resource.name': 'foo-prod-'. Must be a match of regex '(?:a-z?)'", u'reason': u'invalid'}

Corrected the machineName and redeployed, failed again and logged

$ nixops deploy -d vm-on-gcp
error: cannot change the instance name of a deployed GCE machine 'foo-prod-'

Tried to destroy the resources, this has also failed and logged

$ nixops destroy -d vm-on-gcp --confirm --show-trace
error: {u'locationType': u'parameter', u'domain': u'global', u'message': u"Invalid value 'foo-prod-'. Values must match the following regular expression: 'a-z?'", u'reason': u'invalidParameter', u'location': u'instance'}

To work around this I had to destroy the resources from the GCE console. Force delete the deployment and redeploy with the compliant name.

It would be ideal if this get addressed.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions