Uploaded image for project: 'Insights Experiences'
  1. Insights Experiences
  2. HMS-3880

Creating several concurrent GCP instances with the same `name_pattern` tends to fail

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • Provisioning

      When trying to create several instances at the same time using the same `name_pattern', usually only one of the requests succeeds while the rest fails.

      This is the payload used in this case:

      {'amount': 1, 'image_id': 'XXXXXX', 'poweroff': True, 'pubkey_id': XXXXXX, 'source_id': 'XXXXXX', 'launch_template_id': 'global-e2-micro-spot-delete-it', 'machine_type': 'e2-micro', 'zone': 'us-central1-a', 'name_pattern': 'rhel-8-pmendezh-YYYYYYYY'}

      The error returned is:

       

      ERROR: cannot run instances for gcp client: cannot bulk insert instances: googleapi: Error 409: CONFLICT: errors:{code:"VM_MIN_COUNT_NOT_REACHED"  message:"Requested minimum count of 1 VMs could not be created."}  errors:{code:"RESOURCE_ALREADY_EXISTS"  message:"The resource 'projects/pmendezh/zones/us-central1-a/disks/rhel-8-pmendezh-YYYYYYYY-00001' already exists"}
      . . .
      ERROR: cannot run instances for gcp client: cannot bulk insert instances: googleapi: Error 409: CONFLICT: errors:{code:"VM_MIN_COUNT_NOT_REACHED"  message:"Requested minimum count of 1 VMs could not be created."}  errors:{code:"RESOURCE_ALREADY_EXISTS"  message:"The resource 'projects/pmendezh/zones/us-central1-a/disks/rhel-8-pmendezh-YYYYYYYY-00003' already exists"}
      

      According to the documentation at https://developers.stage.redhat.com/api-catalog/api/launch, "Furthermore, by specifying the RFC-1035 compatible name pattern for example as "instance", instances names will be created in the format: "instance-#####".", so this kind of request should be accepted (both AWS and Azure accept a similar parameter and create the required instances).

            Unassigned Unassigned
            rhn-engineering-pablomh Pablo Méndez Hernández
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: