[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-18 Thread Alessio B.
Thank you very much for the clear help!
___
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/2KO3C5IYUGPQTC7G2NB4FA6CP2WSMEJW/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-14 Thread Martin Necas
You are not providing any other parameters that's why it does not reboot.
In ansible, you are inputting what state you want to have the machine.

Let's say that you have some running VM with 2GiB of RAM and you want to
change it to 4GiB.
If you will start the playbook for the first time it will change to 4GiB
and reboot,
but the second time no changes because it already has 4GiB, so no change
needed.

The same goes for the boot, I guess the VM already had HD boot and you were
trying to change it to it,
ansible checked that it was not necessary.

On Fri, May 14, 2021 at 8:25 PM Alessio B. 
wrote:

> Hi Martin,
>
> Thank you for the help, I have modified my playbook without the first task.
> Here is it:
>
> - name: Change state in next_run and reboot
>   ovirt_vm:
> name: "{{ item.name }}"
> auth: "{{ ovirt_auth }}"
> state: next_run
> wait: true
>   with_items:
> - "{{ vm_result.ovirt_vms }}"
>   ignore_errors: true
>
> The VMs doesn't reboot. Nothing has changed, I can't understand where is
> my error.
>
> Here my scenario by ansible playbook:
>
> 1) turn on VMs (Works fine)
> 2) first reboot (NO)
> 3) second reboot (NO)
> ___
> 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/CMOUQHPWKPP3RSYSDVAQBI4TLH3WK2EB/
>
___
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/6RM4CFJ2FNRFAAUCSB3KXLOBWHTJKLXG/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-14 Thread Alessio B.
Hi Martin,

Thank you for the help, I have modified my playbook without the first task.
Here is it:

- name: Change state in next_run and reboot
  ovirt_vm:
name: "{{ item.name }}"
auth: "{{ ovirt_auth }}"
state: next_run
wait: true
  with_items:
- "{{ vm_result.ovirt_vms }}"
  ignore_errors: true

The VMs doesn't reboot. Nothing has changed, I can't understand where is my 
error.

Here my scenario by ansible playbook:

1) turn on VMs (Works fine)
2) first reboot (NO)
3) second reboot (NO)
___
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/CMOUQHPWKPP3RSYSDVAQBI4TLH3WK2EB/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-14 Thread Martin Necas
On Fri, May 14, 2021 at 6:57 PM Martin Necas  wrote:

>  Hi Alessio,
>
> I just tested it and it seems to be working without a problem.
>
> To explain the examples which you sent, might help.
>
> The `next_run: true` "prepares" the VM parameters and after reboot, the
> parameters will be set.
> I noticed that you did not set any parameter to the VM in that task, so it
> has nothing to do.
>
> And as for the second example, with `state: next_run`, this updates the
> parameters and reboots automatically.
>
It checks the state of the parameters if it should update them or not, if
it is already HD it does not need any update so it just passes.

> Please check out if the VM does not already have boot_devices set to hard
> disk.
>

> Martin Necas
>
> On Fri, May 14, 2021 at 1:36 PM Alessio B. <
> alessio.battaglia.1...@gmail.com> wrote:
>
>> Hi,
>>
>> in debug mode I haven't any error.
>> The reboot can't be invoked when the VMs are in running state.
>> ___
>> 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/FBHDUVENYMKPZVUH4YBXXSJ3K7UA2AVQ/
>>
>
___
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/RQZJPBPRVXTTWO4JTY26JKAQBZWJBG47/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-14 Thread Martin Necas
 Hi Alessio,

I just tested it and it seems to be working without a problem.

To explain the examples which you sent, might help.

The `next_run: true` "prepares" the VM parameters and after reboot, the
parameters will be set.
I noticed that you did not set any parameter to the VM in that task, so it
has nothing to do.

And as for the second example, with `state: next_run`, this updates the
parameters and reboots automatically.
Please check out if the VM does not already have boot_devices set to hard
disk.

Martin Necas

On Fri, May 14, 2021 at 1:36 PM Alessio B. 
wrote:

> Hi,
>
> in debug mode I haven't any error.
> The reboot can't be invoked when the VMs are in running state.
> ___
> 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/FBHDUVENYMKPZVUH4YBXXSJ3K7UA2AVQ/
>
___
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/EV6QQX6BFLKTVZYDFOQG6PZR6PKK4WQS/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-14 Thread Klaas Demter

Shouldn't it be opened against the ovirt collection?

https://github.com/oVirt/ovirt-ansible-collection/issues

On 11/5/18 11:23 AM, Ondra Machacek wrote:

Joey is right, we don't such functionality. But feel free to open an
issue here[1] and we can implement it.

[1] https://github.com/ansible/ansible/issues

On 11/3/18 1:10 AM, Joey Ma wrote:

hi,

AFAIK, setting state=stopped is the only way to poweroff a VM. While to
reboot a VM, you could also follow the steps below:
1. Update a VM with some new properties that requires a restart 
operation,

also with the param: next_run=true
2. Set state=next_run in your playbook and apply it

Then the VM could reboot automatically.

On Sat, Nov 3, 2018 at 1:19 AM Nathanaël Blanchet  
wrote:


Hello, is there a way to poweroff or reboot (without stopped and 
running

state) a vm with the ovirt_vm ansible module?

--
Nathanaël Blanchet

Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5
Tél. 33 (0)4 67 54 84 55
Fax  33 (0)4 67 54 84 14
blanc...@abes.fr
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/EBJOTJJKW3TGI63D2FXAK53ORXEUU3LO/ 






___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/L5PEO3WOODJIB2WOV4HW2JD7UFOX2CVF/



___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/3HPGM2N7WTTV5SDH6BQ7PVDLRTLUZY2R/

___
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/SNUR4QZGTD4RE22WPWNDCVL6FBU76F5J/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-14 Thread Alessio B.
Hi,

in debug mode I haven't any error.
The reboot can't be invoked when the VMs are in running state.
___
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/FBHDUVENYMKPZVUH4YBXXSJ3K7UA2AVQ/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-14 Thread Strahil Nikolov via Users
Hi,

the info is not enough. Can you provide the error you receive.Most probably you 
will need to enable some debug to identify the issue.
Best Regards,Strahil Nikolov
 
 
  On Fri, May 14, 2021 at 12:44, Alessio B. 
wrote:   Hello, sorry if I continue in this thread but I have the same issue.
This solution in my case doesn't work and the VM can't reboot after an update 
task like this 

    - name: Set next_run
      ovirt_vm:
        next_run: yes
        name: "{{ item.name }}"
        auth: "{{ ovirt_auth }}"
        wait: true
      with_items:
        - "{{ vm_result.ovirt_vms }}"
      ignore_errors: true

    - name: Change state in next_run and reboot
      ovirt_vm:
        name: "{{ item.name }}"
        auth: "{{ ovirt_auth }}"
        state: next_run
        wait: true
        boot_devices:
          - hd
      with_items:
        - "{{ vm_result.ovirt_vms }}"
      ignore_errors: true

What's wrong? Thank you!
___
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/CYVEOCXTZLREOWMH7RW4MDBL364UIL4C/
  
___
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/5PMGZ66ZPICJDL5LQ2KDYI3IJLOF5VDE/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2021-05-14 Thread Alessio B.
Hello, sorry if I continue in this thread but I have the same issue.
This solution in my case doesn't work and the VM can't reboot after an update 
task like this 

- name: Set next_run
  ovirt_vm:
next_run: yes
name: "{{ item.name }}"
auth: "{{ ovirt_auth }}"
wait: true
  with_items:
- "{{ vm_result.ovirt_vms }}"
  ignore_errors: true

- name: Change state in next_run and reboot
  ovirt_vm:
name: "{{ item.name }}"
auth: "{{ ovirt_auth }}"
state: next_run
wait: true
boot_devices:
  - hd
  with_items:
- "{{ vm_result.ovirt_vms }}"
  ignore_errors: true

What's wrong? Thank you!
___
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/CYVEOCXTZLREOWMH7RW4MDBL364UIL4C/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2018-11-05 Thread Ondra Machacek

Joey is right, we don't such functionality. But feel free to open an
issue here[1] and we can implement it.

[1] https://github.com/ansible/ansible/issues

On 11/3/18 1:10 AM, Joey Ma wrote:

hi,

AFAIK, setting state=stopped is the only way to poweroff a VM. While to
reboot a VM, you could also follow the steps below:
1. Update a VM with some new properties that requires a restart operation,
also with the param: next_run=true
2. Set state=next_run in your playbook and apply it

Then the VM could reboot automatically.

On Sat, Nov 3, 2018 at 1:19 AM Nathanaël Blanchet  wrote:


Hello, is there a way to poweroff or reboot (without stopped and running
state) a vm with the ovirt_vm ansible module?

--
Nathanaël Blanchet

Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5
Tél. 33 (0)4 67 54 84 55
Fax  33 (0)4 67 54 84 14
blanc...@abes.fr
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/EBJOTJJKW3TGI63D2FXAK53ORXEUU3LO/




___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/L5PEO3WOODJIB2WOV4HW2JD7UFOX2CVF/


___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/3HPGM2N7WTTV5SDH6BQ7PVDLRTLUZY2R/


[ovirt-users] Re: poweroff and reboot with ovirt_vm ansible module

2018-11-02 Thread Joey Ma
hi,

AFAIK, setting state=stopped is the only way to poweroff a VM. While to
reboot a VM, you could also follow the steps below:
1. Update a VM with some new properties that requires a restart operation,
also with the param: next_run=true
2. Set state=next_run in your playbook and apply it

Then the VM could reboot automatically.

On Sat, Nov 3, 2018 at 1:19 AM Nathanaël Blanchet  wrote:

> Hello, is there a way to poweroff or reboot (without stopped and running
> state) a vm with the ovirt_vm ansible module?
>
> --
> Nathanaël Blanchet
>
> Supervision réseau
> Pôle Infrastrutures Informatiques
> 227 avenue Professeur-Jean-Louis-Viala
> 34193 MONTPELLIER CEDEX 5
> Tél. 33 (0)4 67 54 84 55
> Fax  33 (0)4 67 54 84 14
> blanc...@abes.fr
> ___
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@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/EBJOTJJKW3TGI63D2FXAK53ORXEUU3LO/
>
___
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@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/L5PEO3WOODJIB2WOV4HW2JD7UFOX2CVF/