Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ovirt_vm: Add "Warm/Cold Reboot" Parameter #174

Closed
scroodj opened this issue Nov 10, 2020 · 2 comments · Fixed by #539
Closed

ovirt_vm: Add "Warm/Cold Reboot" Parameter #174

scroodj opened this issue Nov 10, 2020 · 2 comments · Fixed by #539
Assignees
Labels
enhancement New feature or request

Comments

@scroodj
Copy link

scroodj commented Nov 10, 2020

SUMMARY

The module ovirt_vm has no parameter to control whether a virtual machine should be warm or cold rebooted when started as "Run Once"

  • in the Run Once dialog there is an option called "Rollback this configuration during reboots"
  • in API it is called "volatile"
COMPONENT NAME

ovirt_vm

ADDITIONAL INFORMATION

Use case:
When configure Red Hat Linux installation via Ansible and Kickstart at the end of installation process there is need to reboot a machine. Without "Rollback this configuration during reboots = True" for Run Once process goes to an installation loop.

---
- name: oVirt VM Creation
  hosts: localhost
  connection: local
  vars_files:
    # Contains variables to connect to the engine
    - engine_vars.yml
    # Contains encrypted `engine_password` varibale using ansible-vault
    - passwords.yml
  tasks:
    - block:
        - name: Log in oVirt Engine
          ovirt_auth:
            hostname: "{{ engine_fqdn }}"
            username: "{{ engine_user }}"
            password: "{{ engine_password }}"
            insecure: "{{ engine_insecure | default(true) }}"
        - name: Remove VM, if VM is running it will be stopped
          ovirt_vm:
            auth: "{{ ovirt_auth }}"
            state: absent
            name: "{{ vm_name }}"
        - name: Create VM OS Disk
          ovirt_disk:
            auth: "{{ ovirt_auth }}"
            name: "{{ vm_name }}_OS"
            size: 10GiB
            format: raw
            sparse: True
            storage_domain: data
          register: mydisk
        - name: Create VM
          ovirt_vm:
            auth: "{{ ovirt_auth }}"
            state: running
            cluster: Default
            name: "{{ vm_name }}"
            cd_iso: "{{ iso_file }}"
            boot_devices:
              - hd
            memory: 4GiB
            memory_guaranteed: 4GiB
            memory_max: 4GiB
            cpu_cores: 2
            cpu_sockets: 2
            cpu_shares: 1024
            type: server
            operating_system: rhel_8x64
            disks:
              - name: "{{ vm_name }}_OS"
                bootable: True
                interface: virtio_scsi
            nics:
              - name: nic1
                profile_name: ovirtmgmt
            kernel_path: /opt/kernel/8.2/vmlinuz
            initrd_path: /opt/kernel/8.2/initrd.img
            kernel_params: inst.repo=cdrom inst.ks.sendmac inst.ks=http://{{ web_serv_ip }}:8080/ks.8.2.cfg ip={{ vm_ip }}:::255.255.255.0::eth0:off net.ifnames=0
            kernel_params_persist: false

      always:
        - name: Log out oVirt Engine
          ovirt_auth:
            state: absent
            ovirt_auth: "{{ ovirt_auth }}"
  collections:
    - ovirt.ovirt
@scroodj scroodj added the enhancement New feature or request label Nov 10, 2020
@mwperina
Copy link
Member

mwperina commented Oct 4, 2021

Arik, does it make sense to add that parameter?

@ahadas

@ahadas
Copy link
Member

ahadas commented Oct 4, 2021

Yes, it makes sense exactly for the described use case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants