Persistent AWS Spot Instances (How to)

Hi everybody,

I’m new with linux and need some help, due to the high cost of the instances on demand I decided to switch to the spot instances. I have followed the steps in Using an Existing Instance to use the same instance that was on demand.
I describe the steps I followed:

  1. Stop on demand instance and detach its root volume.

  2. Rename detached volume.

  3. Create a copy of example.conf named my.conf.

  4. I have modified my.conf, specifically:

ec2spotter_volume_name=spotter
ec2spotter_volume_zone=eu-west-1a
ec2spotter_launch_zone=eu-west-1a
ec2spotter_key_name=EUwest
ec2spotter_instance_type=p2.xlarge
ec2spotter_subnet=subnet-xxxxxx
ec2spotter_security_group=sg-xxxxxxx
ec2spotter_preboot_image_id=ami-d8f4deab

Here I launch start_spot.sh and I get the following error:

fast_ai/start_spot.sh: 5: fast_ai/start_spot.sh: Bad substitution
fast_ai/start_spot.sh: 7: .: Can’t open …/my.conf

I think, something I’m doing wrong with my work directory

Thank you!!