[ovirt-users] Re: Power on VM - CLI / API

2020-10-01 Thread Strahil Nikolov via Users
---
- name: Example
  hosts: localhost
  connection: local
  vars:
    ovirt_auth:
      username: 'admin@internal'
      password: 'pass'
      url: 'https://engine.localdomain/ovirt-engine/api'
      insecure: True
      ca_file: '/root/ansible/engine.ca'
 
  - name: Power on {{ outer_item }} after snapshot restore
    ovirt_vm:
      auth: "{{ ovirt_auth }}"
      state: running
      name: "{{ item }}"
    loop:
     - VM1
     - VM2

Yeah, you have to fix the tabulations (both Ansible and Python are pain in the 
*** )

Best Regards,
Strahil Nikolov







В сряда, 30 септември 2020 г., 21:01:26 Гринуич+3, Jeremey Wise 
 написа: 






Can anyone post link.  (with examples.. as most documentation for oVirt lacks 
this)..  where I can power on a VM via CLI or API.

As of now I cannot login to oVirt-Engine.  No errors when I restart it..  
https://lists.ovirt.org/archives/list/users@ovirt.org/thread/45KKF5TN5PRQ3R7MDOWIQTSYZXZRVDIZ/

BUt... I need to get VMs booted.

I tried to follow:
http://ovirt.github.io/ovirt-engine-api-model/master/
and my server's API web portal
https://ovirte01.penguinpages.local/ovirt-engine/apidoc/#/documents/003_common_concepts

And.. even get POSTMAN (real newbie at that tool but ran into how to add 
exported .pem key from portal to session issues)


# failed CLI example:   Power on VM "ns01"
###  DRAFT :: 2020-09-30

# Get key from oVirt engine and import.  Ex: from ovirte01  into server 'thor

curl -k 
'https://ovirte01.penguinpages.local/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA'
 -o ovirt01_ca.pem

sudo cp ovirt01_ca.pem /etc/pki/ca-trust/source/anchors

sudo update-ca-trust extract

 

openssl s_client -connect ovirte01.penguinpages.local:443 -showcerts < /dev/null

 

# Use key during GET list of VMs  

??  

 curl -X POST https://ovirte01.penguinpages.local/post -H 
/ovirt-engine/api/vms/ns01/start HTTP/1.1 


#

I just need to power on VM


-- 
penguinpages
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/UN4AHVRITGBFUJBYATZA2DTUEIJEX6GL/
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/V5XQ5LTSLAKLXRUATQOY4PHSFVC3LVQB/


[ovirt-users] Re: Power on VM - CLI / API

2020-09-30 Thread Klaas Demter
I would suggest to do it via one of the sdks, for example python 
https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/start_vm.py 
- you can create a simple python script you can start from cli.


Alternatively use ansible, you can also call that from cli.


Greetings

Klaas


On 9/30/20 7:57 PM, Jeremey Wise wrote:


Can anyone post link.  (with examples.. as most documentation for 
oVirt lacks this)..  where I can power on a VM via CLI or API.


As of now I cannot login to oVirt-Engine.  No errors when I restart 
it.. 
https://lists.ovirt.org/archives/list/users@ovirt.org/thread/45KKF5TN5PRQ3R7MDOWIQTSYZXZRVDIZ/


BUt... I need to get VMs booted.

I tried to follow:
http://ovirt.github.io/ovirt-engine-api-model/master/
and my server's API web portal
https://ovirte01.penguinpages.local/ovirt-engine/apidoc/#/documents/003_common_concepts

And.. even get POSTMAN (real newbie at that tool but ran into how to 
add exported .pem key from portal to session issues)



# failed CLI example:   Power on VM "ns01"

###  DRAFT :: 2020-09-30

# Get key from oVirt engine and import.  Ex: from ovirte01  into 
server 'thor


curl -k 
'https://ovirte01.penguinpages.local/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA' 
-o ovirt01_ca.pem


sudo cp ovirt01_ca.pem /etc/pki/ca-trust/source/anchors

sudo update-ca-trust extract

openssl s_client -connect ovirte01.penguinpages.local:443 -showcerts < 
/dev/null


 

# Use key during GET list of VMs

?? 

 curl -X POST https://ovirte01.penguinpages.local/post -H 
/ovirt-engine/api/vms/ns01/start HTTP/1.1 
 





#

I just need to power on VM


--
p enguinpages

___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/UN4AHVRITGBFUJBYATZA2DTUEIJEX6GL/
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/HKZEUDCHODKDMKWBST36655VW3TEC4M3/