Skip to content

--security-group-ids is silently dropped on spawn launch: instances always get the default SG (breaks --efs-id) #667

Closed

Description

@scttfrdmn

Summary

On the spawn launch path (non-MPI, non-Windows), --security-group-ids is parsed into sgIDs (cmd/launch_flags.go:239) but never copied into config.SecurityGroupIDs. The only assignment from sgIDs is in cmd/launch_batchqueue.go:206. So the instance always launches in the VPC default SG, and nothing warns.

Repro (0.116.0 @528e038, us-east-1)

spawn launch gchp-efs-probe2 --instance-type t4g.small --region us-east-1 --az us-east-1a \
  --security-group-ids sg-000428c638979878c --efs-id fs-0b7c24a0814746796 ...

On the instance, IMDS meta-data/security-groups returns default, and describe-instances shows only sg-b8fbc380 (default).

Impact

  • --efs-id cannot work unless the EFS mount target happens to sit in the default SG. Here the mount target used sg-000428c…, so TCP 2049 was blocked. The user-data mount -t nfs4 ... hard then hangs, and /efs stays empty (see the linked ordering bug).
  • The same applies to anything that relies on a custom SG: FSx (EnsureLustrePorts loops over an empty config.SecurityGroupIDs), or SSH from a restricted CIDR.
  • Fixing it by hand (modify-instance-attribute --groups default sg-000428c…) unblocked the hung mount within about 12 s.

Fix

Copy sgIDs into config.SecurityGroupIDs in launch config building, as batchqueue does. Also add a regression test asserting the RunInstances input carries the flag's SGs. Related: #659 (--mpi overwrites the flag on purpose; this bug is the non-MPI path dropping it by accident).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions