Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* azure: remove delete_on_termination flag
* enhance docs
* improve delete command
  • Loading branch information
cicharka authored Apr 8, 2022
1 parent 64a962f commit 9003c68
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion cli/epicli.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ def delete_parser(subparsers):
sub_parser._action_groups.append(optional)

def run_delete(args):
if not query_yes_no('Do you really want to delete your cluster?'):
if not query_yes_no('''You are trying to delete your cluster.
If your configuration does not allow to keep existing disks used in the cluster, you will lose your data.
Make sure your data is safe. Do you really want to delete your cluster?'''):
return 0
adjust_paths_from_build(args)
with Delete(args) as cmd:
Expand Down
1 change: 1 addition & 0 deletions docs/changelogs/CHANGELOG-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
- [#2995](https://github.com/epiphany-platform/epiphany/issues/2995) - Update expired RHUI client certificate before installing any RHEL packages
- [#3049](https://github.com/epiphany-platform/epiphany/issues/3049) - HAProxy upgrade fails on re-run trying to remove haproxy_exporter
- [#3006](https://github.com/epiphany-platform/epiphany/issues/3006) - install 'containerd.io=1.4.12-*' failed, when upgrade from v1.3.0 to 2.0.0dev
- [#3065](https://github.com/epiphany-platform/epiphany/issues/3065) - Flag `delete_os_disk_on_termination` has no effect when removing cluster

### Updated

Expand Down
5 changes: 5 additions & 0 deletions docs/home/howto/CLUSTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,11 @@ Epicli has a delete command to remove a cluster from a cloud provider (AWS, Azur

From the defined cluster build folder it will take the information needed to remove the resources from the cloud provider.

### Note for Azure cloud provider

Make sure you can safely remove OS and data disks - Epiphany does not support cluster removal from Azure
while preserving existing disks.

## Single machine cluster

*Please read first prerequisites related to [hostname requirements](./PREREQUISITES.md#hostname-requirements).*
Expand Down
1 change: 0 additions & 1 deletion schema/azure/defaults/infrastructure/virtual-machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ specification:
sku: 20_04-lts-gen2
version: "20.04.202201100" # Never put latest on anything! Need to always pin the version number but testing we can get away with it
storage_os_disk:
delete_on_termination: false
managed: true
caching: ReadWrite
create_option: FromImage
Expand Down
2 changes: 0 additions & 2 deletions schema/azure/validation/infrastructure/virtual-machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ properties:
storage_os_disk:
type: object
properties:
delete_on_termination:
type: boolean
managed:
type: boolean
caching:
Expand Down
4 changes: 0 additions & 4 deletions terraform/azure/infrastructure/virtual-machine.j2
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ resource "azurerm_virtual_machine" "{{ specification.name }}" {
# windows specific stuff here maybe... hopefully never.
{%- endif %}

{%- if specification.storage_os_disk.managed %}
delete_os_disk_on_termination = "{{ specification.storage_os_disk.delete_on_termination | lower }}"
{%- endif %}

storage_os_disk {
name = "{{ specification.name }}-os-disk"
caching = "{{ specification.storage_os_disk.caching }}"
Expand Down

0 comments on commit 9003c68

Please sign in to comment.