Can you share the ansible output?

On Mon, Feb 17, 2020 at 5:02 PM Nazan CENGİZ <nazancengiz@havelsan.com.tr> wrote:

Hi sir,

thanks for reply.

I am running script on ovirt engine then I create NFS directory.

I create ca.crt on command;

 curl --insecure "https://ovirtengine2.5ghvl.local/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA" -o ca.crt

[root@ovirtengine2 ovirt-engine]# cat ca.pem
-----BEGIN CERTIFICATE-----
MIIDzzCCAregAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwTDELMAkGA1UEBhMCVVMx
FDASBgNVBAoMCzVnaHZsLmxvY2FsMScwJQYDVQQDDB5vdmlydGVuZ2luZTIuNWdo
dmwubG9jYWwuNzUzNjIwHhcNMjAwMTE4MTM0MDU4WhcNMzAwMTE2MTM0MDU4WjBM
MQswCQYDVQQGEwJVUzEUMBIGA1UECgwLNWdodmwubG9jYWwxJzAlBgNVBAMMHm92
aXJ0ZW5naW5lMi41Z2h2bC5sb2NhbC43NTM2MjCCASIwDQYJKoZIhvcNAQEBBQAD
ggEPADCCAQoCggEBALnK88wsdQDu5mZ1cDJ9E6kJgvH35atQ1b0xtZ6NRHnBeoB1
W+i8WG2kCn0pzG9uY3Y2E8G4Ngpx5e/CAZUZpPwyUXUDwcQUOR8Kd8HF6HOs0Cbs
7Ansoa5I02MUjNOuEJra5sKXvog3oND/yoP3Tn+wLKHYkHcMsW91DEfGUPmu9J1o
Ti53P9dHAVzW5WbOV2pugsR/Wd7+NUTr9ewxo53yMoCs4Bu/K6+AD6wyPiZABEOA
WmoopvP/X4D43+vufcrelsFHb7+oyPsLGyfeYl87HMOes7v0rkf7/P0V+EA9GiUi
w2Hvi6xOs9kebD+98RKzHRv8CqxXg+DvszYRHvMCAwEAAaOBujCBtzAdBgNVHQ4E
FgQUmKTupON8PwJpmn8oPdMkfIJ9UyUwdQYDVR0jBG4wbIAUmKTupON8PwJpmn8o
PdMkfIJ9UyWhUKROMEwxCzAJBgNVBAYTAlVTMRQwE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F6HOs0Cbs7Ansoa5I
02MUjNOuEJra5sKXvog3oND/yoP3Tn+wLKHYkHcMsW91DEfGUPmu9J1oTi53P9dHAVzW5WbOV2pu
gsR/Wd7+NUTr9ewxo53yMoCs4Bu/K6+AD6wyPiZABEOAWmoopvP/X4D43+vufcrelsFHb7+oyPsL
GyfeYl87HMOes7v0rkf7/P0V+EA9GiUiw2Hvi6xOs9kebD+98RKzHRv8CqxXg+DvszYRHvMCAwEA
AaOBujCBtzAdBgNVHQ4EFgQUmKTupON8PwJpmn8oPdMkfIJ9UyUwdQYDVR0jBG4wbIAUmKTupON8
PwJpmn8oPdMkfIJ9UyWhUKROMEwxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAs1Z2h2bC5sb2NhbDEn
MCUGA1UEAwweb3ZpcnRlbmdpbmUyLjVnaHZsLmxvY2FsLjc1MzYyggIQADAPBgNVHRMBAf8EBTAD
AQH/MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEAFsK8y7QFKaEj6KwgHCo03pWf
yrGu7oRogXMSHZXQweWJA5dbdgNyHJ00lpz20QnBC04v+p8wt0rx9Od0yD4yM+2E8Q8aNg9c7+il
cTUrN1aYsn61mju9peD5Jjkw60w8YNJKc+L1/emfDE8baLCw10BwnL+aFyTS9U8P0rjamqyFyP2c
i7cQgCz3QjXE0KzXkPUd1v3z8JCXa8tBwznFvS3icL0Wy0SfHOz+1ECrQmjpUOm4/ej7TVgAX7GU
4fCQAJXQd0s6Z4Qn3o/IgVm4AqFLzAAISCbQEIiZV+cx+YRFeLVzCtp0cg5mkGsaWd+x604MrDa9
skXqUY16oLe6yQ==
-----END CERTIFICATE-----

ca.crt and ca.pem both file.I am using ca.crt.

I only one have cluster name is Default;

My backup vm Bacchus



Config file;


[root@ovirtengine2 ovirt_ansible_backup]# cat backup_ovirt_vms.yml
---
- hosts: localhost
  connection: local

  vars:
    host: ovirtbackup.5ghvl.local
    cluster: Default
    in_progress_path: "/mnt/backup/in_progress/"
    completed_path: "/mnt/backup/completed/"
    file_ext: ova
    retain_days: 10
    vms:
      - Bacchus


  tasks:
    - name: "Authenticate"
      ovirt_auth:
        username: admin@internal
        ca_file: /etc/pki/ovirt-engine/ca.crt
        password: "hvl"

    - name: "Backup VMs"
      include_tasks: export_vm.yml
      loop: "{{ vms }}"

    - name: "Clean Backups"
      include_tasks: cleanup.yml
      loop: "{{ vms }}"

    - name: "Remove SSO token"
      ovirt_auth:
        state: absent
        ovirt_auth: "{{ ovirt_auth }}"
      tags: always


But it is failed;




Nfs mounting;




From: Jayme <jaymef@gmail.com>
Sent: Monday, February 17, 2020 9:25:44 PM
To: Nazan CENGİZ
Cc: users@ovirt.org
Subject: Re: [ovirt-users] backup
 
Hello,

I have not used this script myself so I don't have a resolution for you, however I recently wrote an article regarding a simple method to backup oVirt VMs using ansible without the need of any complicated software or proxy VMs involved. Here is the link to the article if it's helpful to you: https://blog.silverorange.com/backing-up-ovirt-vms-with-ansible-4c2fca8b3b43

On Mon, Feb 17, 2020 at 2:11 PM Nazan CENGİZ <nazancengiz@havelsan.com.tr> wrote:

Hi all,

I am trying https://github.com/vacosta94/VirtBKP.

ovirt version:4.3.5

my config file;

[bkp]
url             = https://xxx/ovirt-engine/api
user            = admin@internal
password        = yyy
ca_file         = /opt/VirtBKP/ca.crt
bkpvm           = VirtBKM
bckdir          = /mnt/backup

[restore]
url             = https:/xxx/ovirt-engine/api
user            = admin@internal
password        = yyy
ca_file         = ca.crt
storage         = hosted_storage(storage domain name for new vm???)
proxy           = xxx(engine FQDN)
proxyport       = 54323

Fail on below;


[root@virtbkp VirtBKP]# /opt/VirtBKP/backup_vm.py default.conf Bacchus
[OK] Connection to oVIrt API success https://ovirtengine2.5ghvl.local/ovirt-engi                                                                                                             ne/api
[INFO] Trying to create snapshot of VM: 8a95f435-94dd-4a69-aed0-46395bcbd082
[INFO] Waiting until snapshot creation ends
[INFO] Waiting until snapshot creation ends
[OK] Snapshot created
[INFO] Trying to create a qcow2 file of disk aa564596-fd33-4734-8050-0f82130a677b
[INFO] Attach snap disk to bkpvm
Traceback (most recent call last):
  File "/opt/VirtBKP/backup_vm.py", line 6, in <module>
    b.main()
  File "/opt/VirtBKP/backup_vm_last.py", line 242, in main
    self.backup(self.vmid,self.snapid,disk_id,self.bkpvm)
  File "/opt/VirtBKP/backup_vm_last.py", line 210, in backup
    self.attach_disk(bkpvm,disk_id,snapid)
  File "/opt/VirtBKP/backup_vm_last.py", line 123, in attach_disk
    resp_attach = requests.post(urlattach, data=xmlattach, headers=headers, verify=False, auth=(self.user,self.password))
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 112, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 498, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 441, in prepare_request
    hooks=merge_hooks(request.hooks, self.hooks),
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 309, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 377, in prepare_url
    raise InvalidURL(*e.args)




Nazan CENGİZ
AR-GE MÜHENDİSİ
Mustafa Kemal Mahallesi 2120 Cad. No:39 06510 Çankaya Ankara TÜRKİYE
+90 312 219 57 87 +90 312 219 57 97
YASAL UYARI: Bu elektronik posta işbu linki kullanarak ulaşabileceğiniz Koşul ve Şartlar dokümanına tabidir.
LEGAL NOTICE: This e-mail is subject to the Terms and Conditions document which can be accessed with this link.
Lütfen gerekmedikçe bu sayfa ve eklerini yazdırmayınız / Please consider the environment before printing this email

_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-leave@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/NDLWEVOS6MEASC5KUDSMYZIKCH7NHVNB/