Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Allow to preserve OS images when run 'epicli apply' for existing cluster #2288

Closed
8 of 12 tasks
to-bar opened this issue May 5, 2021 · 1 comment
Closed
8 of 12 tasks
Assignees
Labels
area/terraform priority/medium Task with medium priority python Pull requests that update Python code type/improvement
Milestone

Comments

@to-bar
Copy link
Contributor

to-bar commented May 5, 2021

Is your feature request related to a problem? Please describe.
When we release version with updated default OS image and run it for existing cluster deployed with older image, Terraform will detect the difference and may destroy existing VMs.

For AWS, it fails:

14:14:44 ERROR cli.engine.terraform.TerraformCommand - Error: error deleting Autoscaling Launch Configuration (aws-rhel-infra-test-repository-launch-config): ResourceInUse: Cannot delete launch configuration aws-rhel-infra-test-repository-launch-config because it is attached to AutoScalingGroup aws-rhel-infra-test-repository-asg-0
14:14:44 INFO cli.engine.terraform.TerraformCommand -   status code: 400, request id: 1c892f6e-2abb-4eba-ba05-134bbe27e6fd

For Azure, it did nothing (no failure) after changing from 7-RAW/7.6.2018103108 to 7-RAW/7.7.2019090418 but failed after changing from 7-RAW/7.6.2018103108 to 7-LVM/7.9.2020111202:

14:48:58 ERROR cli.engine.terraform.TerraformCommand - Error: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="ConflictingUserInput" Message="Disk az-infra-test-repository-vm-0-os-disk already exists in resource group AZ-INFRA-TEST-RG. Only CreateOption.Attach is supported." Target="/subscriptions/XXX/resourceGroups/az-infra-test-rg/providers/Microsoft.Compute/disks/az-infra-test-repository-vm-0-os-disk"

Because we have:
delete_os_disk_on_termination = "false"
the OS disk was not removed.

We want to have a setting or mode to avoid such errors without modifying infrastructure when only OS image was changed.

Describe the solution you'd like
Implement a mechanism to use the current OS images in case of fresh deployment, in case of upgrade between minor/path versions user will stay with the initial ones.

Describe alternatives you've considered
n/a

Additional context
Special requirements for LTS versions (apply after upgrade).


DoD checklist

  • Changelog updated
  • COMPONENTS.md updated / doesn't need to be updated
  • Feature has automated tests
  • Automated tests passed (QA pipelines)
    • apply
    • upgrade
  • Idempotency tested
  • Documentation added / updated / doesn't need to be updated
  • All conversations in PR resolved
  • Solution meets requirements and is done according to design doc
  • Usage compliant with license
  • Backport tasks created / doesn't need to be backported
@przemyslavic
Copy link
Collaborator

przemyslavic commented Jun 1, 2021

Tested:
apply v0.9 -> upgrade to dev -> apply dev
apply dev -> apply dev

I checked different values for default_os_image parameter:

  • ubuntu-18.04-x86_64

  • redhat-7-x86_64

  • centos-7-x86_64

  • centos-7-arm64

  • default

also with changed default specification:

---
kind: infrastructure/virtual-machine
title: "Virtual Machine Infra"
provider: aws
name: default
specification:
  os_full_name: RHEL-7.9_HVM-20210208-x86_64-0-Hourly2-GP2

both for Azure and AWS.

seriva added a commit that referenced this issue Jun 2, 2021
@mkyc mkyc closed this as completed Jun 7, 2021
seriva added a commit that referenced this issue Jun 7, 2021
seriva added a commit that referenced this issue Jun 7, 2021
sbbroot pushed a commit to sbbroot/epiphany that referenced this issue Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/terraform priority/medium Task with medium priority python Pull requests that update Python code type/improvement
Projects
None yet
Development

No branches or pull requests

5 participants