sap-linuxlab / community.sap_infrastructure

Automation for SAP - Collection of Ansible Roles for infrastructure-related tasks for SAP
Apache License 2.0
3 stars 7 forks source link

sap_vm_provision: Add support for AWS EC2 Spot Instances #9

Open marcelmamula opened 2 months ago

marcelmamula commented 2 months ago

amazon.aws.ec2_instance module does not support creation of Spot instances

https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_instance_module.html This module does not support creating EC2 Spot instances.

It would be good to add support for Spot instances by using module amazon.aws.ec2_spot_instance based on user specified variable with extra inputs for Spot specific inputs like Launch Group. https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_spot_instance_module.html

sean-freeman commented 2 months ago

@marcelmamula I don't think this is a good idea, for a handful of reasons:

  1. Homogeneity objective, means appending code for Spot across all Cloud Service Providers. That's a lot of work, re-testing, further bloats the input vars, and would need to be factored into long-term validation testing upon each new release.
  2. Spot are not SAP Certified, so we're adding code that will only ever be applicable to temporary sandboxes (not that I disagree with that for cost-saving). If I recall, AWS AMI are relatively flexible and can be applied to any AWS EC2 VS Instance Type (Profile) - but the other CSPs (if I recall correctly) all place a restriction on x OS Image applied to y Profile, therefore I doubt SLES4SAP / RHEL4SAP OS Images will work with other Spot compute.
  3. Spot may not be fully comprehended by end-users, they may use it by accident or misunderstand - then lose their work.

Primarily No.1 is my reason for this apprehension. I don't have personal time available to code for each platform and re-test.