openvcloud / 0-templates

Apache License 2.0
1 stars 5 forks source link

Snapshot_delete action is not working #122

Open john-kheir opened 6 years ago

john-kheir commented 6 years ago

Scenario

1- Run a Blueprint to create a vm (vm1)

services:
  - github.com/openvcloud/0-templates/sshkey/0.0.1__64a2b0d4:
       name: 'fddc883e'
       dir: '/root/.ssh/'
       passphrase: '64a2b0d4'
  - github.com/openvcloud/0-templates/openvcloud/0.0.1__96769cda:
      name: 'be-g8-3.demo.greenitglobe.com'
      address: 'be-g8-3.demo.greenitglobe.com'
      login: 'gig_qa_1@itsyouonline'
      token: '*****'
      location: 'be-g8-3'
  - github.com/openvcloud/0-templates/vdcuser/0.0.1__56e1a419:
      groups: ['user']
      email: eb8c827b@test.com
      openvcloud: 96769cda
      provider: itsyouonline
      name: 0a64a4ff
  - github.com/openvcloud/0-templates/vdcuser/0.0.1__gig_qa_1:
      email: dina.magdy.mohammed+123@gmail.com
      openvcloud: 96769cda
      provider: itsyouonline
      name: gig_qa_1

  - github.com/openvcloud/0-templates/account/0.0.1__b0ad413e:
      openvcloud: 96769cda
      name: b6369881

  - github.com/openvcloud/0-templates/vdc/0.0.1__5a3aff86:
      account: b0ad413e
      name: e9d41ee7

  - github.com/openvcloud/0-templates/node/0.0.1__b6908c56:
      vdc: 5a3aff86
      sshKey: 64a2b0d4
      name: 6843aae6

actions:
  - template: github.com/openvcloud/0-templates/account/0.0.1
    actions: ['install']
  - template: github.com/openvcloud/0-templates/sshkey/0.0.1
    actions: ['install']
  - template: github.com/openvcloud/0-templates/vdc/0.0.1
    actions: ['install']
  - template: github.com/openvcloud/0-templates/node/0.0.1
    actions: ['install']
  - template: github.com/openvcloud/0-templates/openvcloud/0.0.1
    actions: ['install']
  - template: github.com/openvcloud/0-templates/vdcuser/0.0.1
    actions: ['install']

2- Run another one to create a snapshot for vm1

services:
  - github.com/openvcloud/0-templates/sshkey/0.0.1__64a2b0d4:
       name: 'fddc883e'
       dir: '/root/.ssh/'
       passphrase: '64a2b0d4'
  - github.com/openvcloud/0-templates/openvcloud/0.0.1__4316dbb9:
      name: 'be-g8-3.demo.greenitglobe.com'
      address: 'be-g8-3.demo.greenitglobe.com'
      login: 'gig_qa_1@itsyouonline'
      token: '*****'
      location: 'be-g8-3'
  - github.com/openvcloud/0-templates/vdcuser/0.0.1__gig_qa_1:
      email: dina.magdy.mohammed+123@gmail.com
      openvcloud: 4316dbb9
      provider: itsyouonline
      name: gig_qa_1

  - github.com/openvcloud/0-templates/account/0.0.1__b0ad413e:
      openvcloud: 96769cda
      name: b6369881

  - github.com/openvcloud/0-templates/vdc/0.0.1__5a3aff86:
      account: b0ad413e
      name: e9d41ee7

  - github.com/openvcloud/0-templates/node/0.0.1__b6908c56:
      vdc: 5a3aff86
      sshKey: 64a2b0d4
      name: 6843aae6

actions:
  - template: github.com/openvcloud/0-templates/node/0.0.1
    actions: ['snapshot']
    service: b6908c56

3- Run a blueprint to delete snapshot

services:
  - github.com/openvcloud/0-templates/sshkey/0.0.1__64a2b0d4:
       name: 'fddc883e'
       dir: '/root/.ssh/'
       passphrase: '64a2b0d4'
  - github.com/openvcloud/0-templates/openvcloud/0.0.1__4316dbb9:
      name: 'be-g8-3.demo.greenitglobe.com'
      address: 'be-g8-3.demo.greenitglobe.com'
      login: 'gig_qa_1@itsyouonline'
      token: '*****'
      location: 'be-g8-3'
  - github.com/openvcloud/0-templates/vdcuser/0.0.1__gig_qa_1:
      email: dina.magdy.mohammed+123@gmail.com
      openvcloud: 4316dbb9
      provider: itsyouonline
      name: gig_qa_1

  - github.com/openvcloud/0-templates/account/0.0.1__b0ad413e:
      openvcloud: 96769cda
      name: b6369881

  - github.com/openvcloud/0-templates/vdc/0.0.1__5a3aff86:
      account: b0ad413e
      name: e9d41ee7

  - github.com/openvcloud/0-templates/node/0.0.1__b6908c56:
      vdc: 5a3aff86
      sshKey: 64a2b0d4
      name: 6843aae6

actions:
  - template: github.com/openvcloud/0-templates/node/0.0.1
    actions: ['snapshot_delete']
    service: b6908c56
    args:
        snapshot_epoch: 1529314197

Actual Result

Snapshot hasn't been deleted

katia-e commented 6 years ago

@john-kheir , shouldn't you set snapshot_epoch as an argument of the action snapshot_delete?

john-kheir commented 6 years ago

it was there .. just forget to copy it

katia-e commented 6 years ago

I can't reproduce, for me delete_snapshot works via both blueprints and dsl. If you try to delete via DSL, does it also fail?

katia-e commented 6 years ago

I could recreate is just now. The thing I observed, when I try to delete snapshot from openvcloud, instead of deleting it, it changes last digit of its epoch. So epoch doesn't match anything in the snapshot list. For the second time, when I try to delete the same snapshot by its 'new' epoch, it gets deleted successfully. I can reproduce it without templates, do it is an openvloud problem, and has to be solved there image

grimpy commented 6 years ago

@katia-e yes this is a known problem hence API was deprecated, it is recommended to delete a snapshot by name instead