fastec2 icon indicating copy to clipboard operation
fastec2 copied to clipboard

fe2 terminate doesn't work

Open dzubo opened this issue 6 years ago • 2 comments

fe2 terminate inst1 returns error:

Traceback (most recent call last):
  File "/Users/zubo/anaconda/envs/fastai/bin/fe2", line 10, in <module>
    sys.exit(main())
  File "/Users/zubo/anaconda/envs/fastai/lib/python3.7/site-packages/fastec2/__init__.py", line 9, in main
    else: fire.Fire(EC2)
  File "/Users/zubo/anaconda/envs/fastai/lib/python3.7/site-packages/fire/core.py", line 127, in Fire
    component_trace = _Fire(component, args, context, name)
  File "/Users/zubo/anaconda/envs/fastai/lib/python3.7/site-packages/fire/core.py", line 366, in _Fire
    component, remaining_args)
  File "/Users/zubo/anaconda/envs/fastai/lib/python3.7/site-packages/fire/core.py", line 542, in _CallCallable
    result = fn(*varargs, **kwargs)
  File "/Users/zubo/anaconda/envs/fastai/lib/python3.7/site-packages/fastec2/ec2.py", line 364, in terminate
    sr = SpotRequest.from_instance(self, inst)
  File "/Users/zubo/anaconda/envs/fastai/lib/python3.7/site-packages/fastec2/spot.py", line 20, in from_instance
    return cls(e, d[0])
IndexError: list index out of range

Steps to reproduce:

  1. Create a base ami, as described here: https://www.fast.ai/2019/02/15/fastec2/
  2. fe2 launch inst1 base 80 m5.large
  3. Wait for the instance to launch.
  4. fe2 terminate inst1

dzubo avatar Mar 08 '19 01:03 dzubo

Also, it works fine for the spot instances, fe2 terminate spot1.

dzubo avatar Mar 08 '19 01:03 dzubo

Perhaps try this form fe2 get_instance inst1 terminate

aglavers avatar Mar 11 '19 21:03 aglavers