ansible-collections / ibm.storage_virtualize

GNU General Public License v3.0
3 stars 9 forks source link

can not restore flashcopy snapshot - ibm.spectrum_virtualize.ibm_svc_manage_flashcopy #25

Open scheurer13 opened 2 years ago

scheurer13 commented 2 years ago
SUMMARY

I'm trying to create a Flashcopy mapping using the ibm.spectrum_virtualize.ibm_svc_manage_flashcopy module. Goal is to clone the existing snapshot to the original. So target already exists.

ISSUE TYPE
COMPONENT NAME

Module

ibm.spectrum_virtualize.ibm_svc_manage_flashcopy module

Task

- name: restore_snap_hana | Create FlashCopy mapping for snapshot SVC1
  ibm.spectrum_virtualize.ibm_svc_manage_flashcopy:
    clustername: "asvc0001"
    username: "{{ svc_username }}"
    password: "{{ svc_password }}"
    log_path: /tmp/playbook.debug
    state: present
    name: "restore-{{ item }}"
    copytype: clone
    source: "{{ item }}_snap"
    target: "{{ item }}"
    mdiskgrp: P01_flash_fl921
    consistgrp: "{{ SID }}_restore"
    copyrate: 50
    force: yes
  loop: "{{ SVC1.stdout_lines }}"

"msg": "target [sps9105_TESTdata_vol1] already exists."

ANSIBLE VERSION
ansible [core 2.11.8]
  config file = /etc/ansible/ansible_es/ansible.cfg
  configured module search path = ['/home/schetr/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  ansible collection location = /etc/ansible/ansible_es
  executable location = /usr/bin/ansible
  python version = 3.6.15 (default, Sep 23 2021, 15:41:43) [GCC]
  jinja version = 2.11.2
  libyaml = False
COLLECTION VERSION
Collection              Version
----------------------- -------
ibm.spectrum_virtualize 1.9.0
OS / ENVIRONMENT
Distributor ID: openSUSE
Description:    openSUSE Leap 15.4
Release:        15.4
STEPS TO REPRODUCE
- name: restore_snap_hana | Create FlashCopy mapping for snapshot SVC1
  ibm.spectrum_virtualize.ibm_svc_manage_flashcopy:
    clustername: "asvc0001"
    username: "{{ svc_username }}"
    password: "{{ svc_password }}"
    log_path: /tmp/playbook.debug
    state: present
    name: "restore-{{ item }}"
    copytype: clone
    source: "{{ item }}_snap"
    target: "{{ item }}"
    mdiskgrp: P01_flash_fl921
    consistgrp: "{{ SID }}_restore"
    copyrate: 50
    force: yes
  loop: "{{ SVC1.stdout_lines }}"
EXPECTED RESULTS

Mapping should be created.

Working SVCTASK

svctask mkfcmap -name restore-{{ item }} -autodelete -cleanrate 50 -consistgrp {{ item }}_restore -copyrate 50 -source {{ item }}_snap -target {{ item }}
ACTUAL RESULTS
ok: [sps91051] => (item=sps9105_TESTdata_vol1) => {
    "ansible_loop_var": "item",
    "changed": false,
    "invocation": {
        "module_args": {
            "clustername": "asvc0001",
            "consistgrp": "TEST_restore",
            "copyrate": "50",
            "copytype": "clone",
            "domain": null,
            "force": true,
            "grainsize": null,
            "log_path": "/tmp/playbook.debug",
            "mdiskgrp": "P01_flash_fl921",
            "name": "restore-sps9105_TESTdata_vol1",
            "noconsistgrp": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "source": "sps9105_TESTdata_vol1_snap",
            "state": "present",
            "target": "sps9105_TESTdata_vol1",
            "token": null,
            "username": "fcm",
            "validate_certs": false
        }
    },
    "item": "sps9105_TESTdata_vol1",
    "msg": "target [sps9105_TESTdata_vol1] already exists."
}
Shilpi-J commented 2 years ago

@scheurer13 To use this functionality, target volume must not pre-exist. Please try with a non-existent target volume.

scheurer13 commented 2 years ago

Hello @Shilpi-J , thanks for answer. Target to non pre-exist volumes works. But i think on restore/fallback we have to do a step more and need many free space. On SVC/svctask it is also possible to copy back the target to the source without stop the snapshot.

I´m also missing the "-incremental" feature on ibm_svc_manage_flashcopy. Should i open a pull request for this?

Shilpi-J commented 2 years ago

@scheurer13 The functionality was designed to make it easier for the user and automate the process. I will check if we can do any changes regarding your feedback here. Please go ahead and raise the PR for "incremental", no issues here. Thanks

robinsg commented 1 year ago

I believe you are trying to create a reverse flashcopy to revert the fc source volumes back to their original state.

I'm writing some FC roles and I also want to be able to use this module to create a reverse flashcopy where the target already exists as the source for an existing flashcopy operation.