[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Sina Owolabi
No errors at all
Same results again
Screenshot attached for a better view, but this is where it's at right now:

   sso: true
disk_format: raw
graphical_console:
  protocol:
- spice
- vnc
cloud_init:
  regenerate_ssh_keys: true
  host_name: "{{ vm_fqdn }}"
  dns_search: mydom.internal
  dns_servers:  
  custom_script: |
write_files:
- path: /tmp/setup.sh
  permissions: '0755'
  content: |
#!/bin/bash
echo "$(hostname -f)" >> /tmp/myhostname.txt
ipa-client-install --hostname=`hostname -f` \
--mkhomedir --domain=services.mydom.internal \
--realm=SERVICES.MYDOM.INTERNAL  --no-ntp \
--principal=admin --password= \
--enable-dns-updates --unattended
  user_name: mydomadmin
  root_password: 

- name: Print vm attributes
  ovirt.ovirt.ovirt_vm_info:
auth: "{{ ovirt_auth }}"
pattern: name="{{ vm_fqdn }}"
  register: vm_info
- debug:
msg: "{{ vm_info.ovirt_vms[0] }}"

On Sat, Nov 27, 2021 at 12:51 AM Strahil Nikolov  wrote:
>
> yaml is picky...
>
>
> write_files:
> - path: /tmp/setup.sh
> permissions: '0755'
> content: |
>
> permissions & content should be on the same indentation with path:
>
> - path
>   permissions
>   content
>
> What is the error you receive ?
>
>
> Best Regards,
> Strahil Nikolov
>
> On Sat, Nov 27, 2021 at 1:19, Sina Owolabi
>  wrote:
> ___
> 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/HLTC34PWJICMOLLVCZBE44XOZG7TGWU7/
>


-- 

cordially yours,

Sina Owolabi

+2348176469061
___
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/JSXPORQCJE43VAU43Y53GBKICXNMWU75/


[ovirt-users] Updating hosted-engine from 4.4.5 to latest(4.4.9) fail with "DNF name '_get_key_for_package' is not defined"

2021-11-26 Thread rene . purcell
Hi! I'm having issue updating my nodes, normally I just clicked on them and 
update each of them without problem. I haven't updated since few months, now 
I'm unable to. So I checked the doc and saw that I probably should update my 
engine first so that's what I tried.

Info on my setup:
2 nodes
hosted-engine is ran as a vm on the same cluster
storage is hosted on a NFS share on my qnap.

I'm following the doc 
(https://www.ovirt.org/documentation/upgrade_guide/#updates-between-minor-releases)
 Fast recap I've put hosted-engine in global maintenance mode, installed the 
latest ovirt-release44.rpm on engine, engine-upgrade-check, yum update 
ovirt\*setup\* and finally ran the engine-setup which did not complete 
successfully..

Here's the error I get:
 []
[ INFO  ] DNF Downloaded python3-numexpr-2.7.1-1.el8.x86_64.rpm SKIPPED Already 
downloaded
[ INFO  ] DNF Downloaded perl-encoding-2.22-3.el8.x86_64.rpm SKIPPED Already 
downloaded
[ INFO  ] DNF Downloaded libXft-2.3.3-1.el8.x86_64.rpm SKIPPED Already 
downloaded
[ INFO  ] DNF Downloaded libXi-1.7.10-1.el8.x86_64.rpm SKIPPED Already 
downloaded
[ INFO  ] DNF Downloaded mcpp-2.7.2-20.el8.x86_64.rpm SKIPPED Already downloaded
[ ERROR ] DNF name '_get_key_for_package' is not defined
[ ERROR ] Failed to execute stage 'Package installation': name 
'_get_key_for_package' is not defined
[ INFO  ] DNF Performing DNF transaction rollback
[ INFO  ] Stage: Clean up
  Log file is located at 
/var/log/ovirt-engine/setup/ovirt-engine-setup-20211126111800-qsadme.log
[ INFO  ] Generating answer file 
'/var/lib/ovirt-engine/setup/answers/20211126111839-setup.conf'
[ INFO  ] Stage: Pre-termination
[ INFO  ] Stage: Termination
[ ERROR ] Execution of setup failed

I can't find more info in the log specified in the output, I understand there's 
something wrong with the list of packages the script try to load/update but 
can't find any bug reports or other people having this issue so I'm running out 
of idea..

Anybody have a solutions to try fixing this and complete my engine upgrade to 
4.4.9?

Thanks a lot, have a great day!!
___
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/AMJT6S3HLLZINA6DBSVXVOZ3R76DOSMS/


[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Strahil Nikolov via Users
yaml is picky...

write_files:            - path: /tmp/setup.sh            permissions: '0755'    
        content: |
permissions & content should be on the same indentation with path:
- path  permissions  content
What is the error you receive ?

Best Regards,Strahil Nikolov
 
 
  On Sat, Nov 27, 2021 at 1:19, Sina Owolabi wrote:   
___
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/HLTC34PWJICMOLLVCZBE44XOZG7TGWU7/
  
___
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/RU4B5524HSHMPK4K2CPUJVM4GFMLO73E/


[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Strahil Nikolov via Users
 Yep.

Your code:
 cloud_init:
 custom_script: |
 host_name: "{{ vm_fqdn }}"
 user_name: myadmin
 user_password: 
 write_files:
 - path: /tmp/setup.sh
 permissions: '0755'
 content: |
 #!/bin/bash
 echo "$(hostnamectl)" >> /tmp/myhostname.txt

Yet, in "custom_script" there is no "host_name" (indentation shows that 
host_name is part of the custom script, not to mention the "|" character).

Try with:

 cloud_init:
 host_name: "{{ vm_fqdn }}"
 user_name: myadmin
 # I can't find this one in 
https://docs.ansible.com/ansible/latest/collections/ovirt/ovirt/ovirt_vm_module.html
 #user_password: 
 root_password: 
 custom_script: |
 write_files:
 - path: /tmp/setup.sh
 permissions: '0755'
 content: |
 #!/bin/bash
 echo "$(hostnamectl)" >> /tmp/myhostname.txt



Best Regards,
Strahil Nikolov В петък, 26 ноември 2021 г., 19:33:16 Гринуич+2, 
Staniforth, Paul  написа:  
 
 #yiv9174097940 P {margin-top:0;margin-bottom:0;}Hi Sina,
  These should be part of the cloud-init dictionary and are strict about 
indentation.
e.g. from the documentation.

- name: Run VM with cloud init  ovirt.ovirt.ovirt_vm:    name: rhel7    
template: rhel7    cluster: Default    memory: 1GiB    high_availability: true  
  high_availability_priority: 50  # Available from Ansible 2.5    cloud_init:   
   dns_servers: '8.8.8.8 8.8.4.4'      nic_boot_protocol: static      
nic_ip_address: 10.34.60.86      nic_netmask: 255.255.252.0      nic_gateway: 
10.34.63.254      nic_name: eth1      host_name: example.com      
custom_script: |        write_files:         - content: |             Hello, 
world!           path: /tmp/greeting.txt           permissions: '0644'      
user_name: root      root_password: super_passwordRegards,
 Paul S.
From: Sina Owolabi 
Sent: 26 November 2021 16:43
To: Staniforth, Paul 
Cc: users@ovirt.org 
Subject: Re: [ovirt-users] Re: Creating VMs from templates with their own disks 
Caution External Mail: Do not click any links or open any attachments unless 
you trust the sender and know that the content is safe.

Same thing when its written as 'hostname':

atal: [ovirt.ovirt.trove.internal]: FAILED! => {"changed": false,
"msg": "Unsupported parameters for (ovirt.ovirt.ovirt_vm) module:
hostname Supported parameters include: affinity_gr
gs, affinity_label_mappings, allow_partial_import, auth,
ballooning_enabled, bios_type, boot_devices, boot_menu, cd_iso, clone,
clone_permissions, cloud_init, cloud_init_nics, cloud_i
t, cluster, cluster_mappings, comment, cpu_cores, cpu_mode,
cpu_pinning, cpu_shares, cpu_sockets, cpu_threads,
custom_compatibility_version, custom_emulated_machine,
custom_properties
rotected, description, disk_format, disks, domain_mappings, exclusive,
export_domain, export_ova, fetch_nested, force, force_migrate,
graphical_console, high_availability, high_availa
ority, host, host_devices, id, initrd_path, instance_type, io_threads,
kernel_params, kernel_params_persist, kernel_path, kvm, lease,
lun_mappings, memory, memory_guaranteed, memory_m
e, name, nested_attributes, next_run, nics, numa_nodes,
numa_tune_mode, operating_system, placement_policy,
placement_policy_hosts, poll_interval, quota_id, reassign_bad_macs,
rng_dev
mappings, serial_console, serial_policy, serial_policy_value,
smartcard_enabled, snapshot_name, snapshot_vm, soundcard_enabled, sso,
state, stateless, storage_domain, sysprep, templat
e_version, ticket, timeout, timezone, type, usb_support,
use_latest_template_version, vmware, vnic_profile_mappings, wait,
watchdog, xen"}

On Fri, Nov 26, 2021 at 5:35 PM Sina Owolabi  wrote:
>
> And Paul
>
> when I try to add host_name,  I get this error:
>
> TASK [Creates new virtual machine]
> 
> fatal: [ovirt.ovirt.trove.internal]: FAILED! => {"changed": false,
> "msg": "Unsupported parameters for (ovirt.ovirt.ovirt_vm) module:
> host_name, regenerate_ssh_keys Supported parameter
>  affinity_group_mappings, affinity_label_mappings,
> allow_partial_import, auth, ballooning_enabled, bios_type,
> boot_devices, boot_menu, cd_iso, clone, clone_permissions, cloud_init,
> cl
> ics, cloud_init_persist, cluster, cluster_mappings, comment,
> cpu_cores, cpu_mode, cpu_pinning, cpu_shares, cpu_sockets,
> cpu_threads, custom_compatibility_version, custom_emulated_mach
> m_properties, delete_protected, description, disk_format, disks,
> domain_mappings, exclusive, export_domain, export_ova, fetch_nested,
> force, force_migrate, graphical_console, high_ava
>  high_availability_priority, host, host_devices, id, initrd_path,
> instance_type, io_threads, kernel_params, kernel_params_persist,
> kernel_path, kvm, lease, lun_mappings, memory, memor
> ed, memory_max, migrate, name, nested_attributes, next_run, nics,
> numa_nodes, numa_tune_mode, operating_system, placement_policy,
> placement_policy_hosts, poll_interval, quota_id, reas
> acs, rng_device, 

[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Staniforth, Paul
Hi Sina,

  These should be part of the cloud-init dictionary and are strict about 
indentation.

e.g. from the documentation.


- name: Run VM with cloud init
  ovirt.ovirt.ovirt_vm:
name: rhel7
template: rhel7
cluster: Default
memory: 1GiB
high_availability: true
high_availability_priority: 50  # Available from Ansible 2.5
cloud_init:
  dns_servers: '8.8.8.8 8.8.4.4'
  nic_boot_protocol: static
  nic_ip_address: 10.34.60.86
  nic_netmask: 255.255.252.0
  nic_gateway: 10.34.63.254
  nic_name: eth1
  host_name: example.com
  custom_script: |
write_files:
 - content: |
 Hello, world!
   path: /tmp/greeting.txt
   permissions: '0644'
  user_name: root
  root_password: super_password


Regards,
 Paul S.

From: Sina Owolabi 
Sent: 26 November 2021 16:43
To: Staniforth, Paul 
Cc: users@ovirt.org 
Subject: Re: [ovirt-users] Re: Creating VMs from templates with their own disks

Caution External Mail: Do not click any links or open any attachments unless 
you trust the sender and know that the content is safe.

Same thing when its written as 'hostname':

atal: [ovirt.ovirt.trove.internal]: FAILED! => {"changed": false,
"msg": "Unsupported parameters for (ovirt.ovirt.ovirt_vm) module:
hostname Supported parameters include: affinity_gr
gs, affinity_label_mappings, allow_partial_import, auth,
ballooning_enabled, bios_type, boot_devices, boot_menu, cd_iso, clone,
clone_permissions, cloud_init, cloud_init_nics, cloud_i
t, cluster, cluster_mappings, comment, cpu_cores, cpu_mode,
cpu_pinning, cpu_shares, cpu_sockets, cpu_threads,
custom_compatibility_version, custom_emulated_machine,
custom_properties
rotected, description, disk_format, disks, domain_mappings, exclusive,
export_domain, export_ova, fetch_nested, force, force_migrate,
graphical_console, high_availability, high_availa
ority, host, host_devices, id, initrd_path, instance_type, io_threads,
kernel_params, kernel_params_persist, kernel_path, kvm, lease,
lun_mappings, memory, memory_guaranteed, memory_m
e, name, nested_attributes, next_run, nics, numa_nodes,
numa_tune_mode, operating_system, placement_policy,
placement_policy_hosts, poll_interval, quota_id, reassign_bad_macs,
rng_dev
mappings, serial_console, serial_policy, serial_policy_value,
smartcard_enabled, snapshot_name, snapshot_vm, soundcard_enabled, sso,
state, stateless, storage_domain, sysprep, templat
e_version, ticket, timeout, timezone, type, usb_support,
use_latest_template_version, vmware, vnic_profile_mappings, wait,
watchdog, xen"}

On Fri, Nov 26, 2021 at 5:35 PM Sina Owolabi  wrote:
>
> And Paul
>
> when I try to add host_name,  I get this error:
>
> TASK [Creates new virtual machine]
> 
> fatal: [ovirt.ovirt.trove.internal]: FAILED! => {"changed": false,
> "msg": "Unsupported parameters for (ovirt.ovirt.ovirt_vm) module:
> host_name, regenerate_ssh_keys Supported parameter
>  affinity_group_mappings, affinity_label_mappings,
> allow_partial_import, auth, ballooning_enabled, bios_type,
> boot_devices, boot_menu, cd_iso, clone, clone_permissions, cloud_init,
> cl
> ics, cloud_init_persist, cluster, cluster_mappings, comment,
> cpu_cores, cpu_mode, cpu_pinning, cpu_shares, cpu_sockets,
> cpu_threads, custom_compatibility_version, custom_emulated_mach
> m_properties, delete_protected, description, disk_format, disks,
> domain_mappings, exclusive, export_domain, export_ova, fetch_nested,
> force, force_migrate, graphical_console, high_ava
>  high_availability_priority, host, host_devices, id, initrd_path,
> instance_type, io_threads, kernel_params, kernel_params_persist,
> kernel_path, kvm, lease, lun_mappings, memory, memor
> ed, memory_max, migrate, name, nested_attributes, next_run, nics,
> numa_nodes, numa_tune_mode, operating_system, placement_policy,
> placement_policy_hosts, poll_interval, quota_id, reas
> acs, rng_device, role_mappings, serial_console, serial_policy,
> serial_policy_value, smartcard_enabled, snapshot_name, snapshot_vm,
> soundcard_enabled, sso, state, stateless, storage_do
> rep, template, template_version, ticket, timeout, timezone, type,
> usb_support, use_latest_template_version, vmware,
> vnic_profile_mappings, wait, watchdog, xen"}
>
> On Fri, Nov 26, 2021 at 5:11 PM Staniforth, Paul
>  wrote:
> >
> > Hi Sina,
> >  I get easily confused with cloud-init but shouldn't you be 
> > setting the hostname, username, etc before the custom script?
> >
> > Also, you could rename the disk as a separate play in your playbook.
> >
> > e.g.
> >
> > # Change Disk Name
> > - ovirt.ovirt.ovirt_disk:
> > id: ----
> > storage_domain: data
> > name: "new_disk_name"
> > vm_name: rhel7
> >
> >
> > Regards,
> > 

[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Sina Owolabi
Same thing when its written as 'hostname':

atal: [ovirt.ovirt.trove.internal]: FAILED! => {"changed": false,
"msg": "Unsupported parameters for (ovirt.ovirt.ovirt_vm) module:
hostname Supported parameters include: affinity_gr
gs, affinity_label_mappings, allow_partial_import, auth,
ballooning_enabled, bios_type, boot_devices, boot_menu, cd_iso, clone,
clone_permissions, cloud_init, cloud_init_nics, cloud_i
t, cluster, cluster_mappings, comment, cpu_cores, cpu_mode,
cpu_pinning, cpu_shares, cpu_sockets, cpu_threads,
custom_compatibility_version, custom_emulated_machine,
custom_properties
rotected, description, disk_format, disks, domain_mappings, exclusive,
export_domain, export_ova, fetch_nested, force, force_migrate,
graphical_console, high_availability, high_availa
ority, host, host_devices, id, initrd_path, instance_type, io_threads,
kernel_params, kernel_params_persist, kernel_path, kvm, lease,
lun_mappings, memory, memory_guaranteed, memory_m
e, name, nested_attributes, next_run, nics, numa_nodes,
numa_tune_mode, operating_system, placement_policy,
placement_policy_hosts, poll_interval, quota_id, reassign_bad_macs,
rng_dev
mappings, serial_console, serial_policy, serial_policy_value,
smartcard_enabled, snapshot_name, snapshot_vm, soundcard_enabled, sso,
state, stateless, storage_domain, sysprep, templat
e_version, ticket, timeout, timezone, type, usb_support,
use_latest_template_version, vmware, vnic_profile_mappings, wait,
watchdog, xen"}

On Fri, Nov 26, 2021 at 5:35 PM Sina Owolabi  wrote:
>
> And Paul
>
> when I try to add host_name,  I get this error:
>
> TASK [Creates new virtual machine]
> 
> fatal: [ovirt.ovirt.trove.internal]: FAILED! => {"changed": false,
> "msg": "Unsupported parameters for (ovirt.ovirt.ovirt_vm) module:
> host_name, regenerate_ssh_keys Supported parameter
>  affinity_group_mappings, affinity_label_mappings,
> allow_partial_import, auth, ballooning_enabled, bios_type,
> boot_devices, boot_menu, cd_iso, clone, clone_permissions, cloud_init,
> cl
> ics, cloud_init_persist, cluster, cluster_mappings, comment,
> cpu_cores, cpu_mode, cpu_pinning, cpu_shares, cpu_sockets,
> cpu_threads, custom_compatibility_version, custom_emulated_mach
> m_properties, delete_protected, description, disk_format, disks,
> domain_mappings, exclusive, export_domain, export_ova, fetch_nested,
> force, force_migrate, graphical_console, high_ava
>  high_availability_priority, host, host_devices, id, initrd_path,
> instance_type, io_threads, kernel_params, kernel_params_persist,
> kernel_path, kvm, lease, lun_mappings, memory, memor
> ed, memory_max, migrate, name, nested_attributes, next_run, nics,
> numa_nodes, numa_tune_mode, operating_system, placement_policy,
> placement_policy_hosts, poll_interval, quota_id, reas
> acs, rng_device, role_mappings, serial_console, serial_policy,
> serial_policy_value, smartcard_enabled, snapshot_name, snapshot_vm,
> soundcard_enabled, sso, state, stateless, storage_do
> rep, template, template_version, ticket, timeout, timezone, type,
> usb_support, use_latest_template_version, vmware,
> vnic_profile_mappings, wait, watchdog, xen"}
>
> On Fri, Nov 26, 2021 at 5:11 PM Staniforth, Paul
>  wrote:
> >
> > Hi Sina,
> >  I get easily confused with cloud-init but shouldn't you be 
> > setting the hostname, username, etc before the custom script?
> >
> > Also, you could rename the disk as a separate play in your playbook.
> >
> > e.g.
> >
> > # Change Disk Name
> > - ovirt.ovirt.ovirt_disk:
> > id: ----
> > storage_domain: data
> > name: "new_disk_name"
> > vm_name: rhel7
> >
> >
> > Regards,
> >Paul S.
> >
> > 
> > From: Sina Owolabi 
> > Sent: 26 November 2021 15:00
> > To: Staniforth, Paul 
> > Cc: users@ovirt.org 
> > Subject: Re: [ovirt-users] Re: Creating VMs from templates with their own 
> > disks
> >
> >
> > Caution External Mail: Do not click any links or open any attachments 
> > unless you trust the sender and know that the content is safe.
> >
> > Thanks Paul.
> >
> > I seem to be getting this by hand, but trying with ansible, I think my 
> > skills are a bit lacking.
> > I can create with ansible, and it seems to work well, except for the fact 
> > that the new vm is
> > created with the hostname of the vm from which the template was made.
> > The disk is also named by the template.
> > My ansiblle yaml is below and I'm pretty sure its wrong (especially where 
> > it needs to use cloud-init to inject the correct hostname, and the other 
> > prepping I would like to add).
> > Please can you help correct me?
> >
> > ---
> > - hosts: ovirt.ovirt.mydom.internal
> >   tasks:
> > - import_tasks: ovirt_auth.yml
> >
> > - name: Creates new virtual machine
> >   ovirt.ovirt.ovirt_vm:
> > auth: 

[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Sina Owolabi
And Paul

when I try to add host_name,  I get this error:

TASK [Creates new virtual machine]

fatal: [ovirt.ovirt.trove.internal]: FAILED! => {"changed": false,
"msg": "Unsupported parameters for (ovirt.ovirt.ovirt_vm) module:
host_name, regenerate_ssh_keys Supported parameter
 affinity_group_mappings, affinity_label_mappings,
allow_partial_import, auth, ballooning_enabled, bios_type,
boot_devices, boot_menu, cd_iso, clone, clone_permissions, cloud_init,
cl
ics, cloud_init_persist, cluster, cluster_mappings, comment,
cpu_cores, cpu_mode, cpu_pinning, cpu_shares, cpu_sockets,
cpu_threads, custom_compatibility_version, custom_emulated_mach
m_properties, delete_protected, description, disk_format, disks,
domain_mappings, exclusive, export_domain, export_ova, fetch_nested,
force, force_migrate, graphical_console, high_ava
 high_availability_priority, host, host_devices, id, initrd_path,
instance_type, io_threads, kernel_params, kernel_params_persist,
kernel_path, kvm, lease, lun_mappings, memory, memor
ed, memory_max, migrate, name, nested_attributes, next_run, nics,
numa_nodes, numa_tune_mode, operating_system, placement_policy,
placement_policy_hosts, poll_interval, quota_id, reas
acs, rng_device, role_mappings, serial_console, serial_policy,
serial_policy_value, smartcard_enabled, snapshot_name, snapshot_vm,
soundcard_enabled, sso, state, stateless, storage_do
rep, template, template_version, ticket, timeout, timezone, type,
usb_support, use_latest_template_version, vmware,
vnic_profile_mappings, wait, watchdog, xen"}

On Fri, Nov 26, 2021 at 5:11 PM Staniforth, Paul
 wrote:
>
> Hi Sina,
>  I get easily confused with cloud-init but shouldn't you be 
> setting the hostname, username, etc before the custom script?
>
> Also, you could rename the disk as a separate play in your playbook.
>
> e.g.
>
> # Change Disk Name
> - ovirt.ovirt.ovirt_disk:
> id: ----
> storage_domain: data
> name: "new_disk_name"
> vm_name: rhel7
>
>
> Regards,
>Paul S.
>
> 
> From: Sina Owolabi 
> Sent: 26 November 2021 15:00
> To: Staniforth, Paul 
> Cc: users@ovirt.org 
> Subject: Re: [ovirt-users] Re: Creating VMs from templates with their own 
> disks
>
>
> Caution External Mail: Do not click any links or open any attachments unless 
> you trust the sender and know that the content is safe.
>
> Thanks Paul.
>
> I seem to be getting this by hand, but trying with ansible, I think my skills 
> are a bit lacking.
> I can create with ansible, and it seems to work well, except for the fact 
> that the new vm is
> created with the hostname of the vm from which the template was made.
> The disk is also named by the template.
> My ansiblle yaml is below and I'm pretty sure its wrong (especially where it 
> needs to use cloud-init to inject the correct hostname, and the other 
> prepping I would like to add).
> Please can you help correct me?
>
> ---
> - hosts: ovirt.ovirt.mydom.internal
>   tasks:
> - import_tasks: ovirt_auth.yml
>
> - name: Creates new virtual machine
>   ovirt.ovirt.ovirt_vm:
> auth: "{{ ovirt_auth }}"
> name: "{{ vm_fqdn }}"
> state: present
> clone: true
> cluster: lrg0-ovirt-cluster
> storage_domain: lrg0-ovirt-mydom-internal-Local
> memory: 16GiB
> cpu_cores: 8
> cpu_sockets: 2
> template: template-test00-centos8
> type: server
> operating_system: other_linux
> sso: true
> disk_format: raw
> #disks:
> #  - name: "{{ vm_fqdn }}-disk0"
> #bootable: true
> #nics:
> #  - name: nic1
> #boot_protocol: dhcp
> #interface: virtio
> #profile_name: "{{ net_profile_name }}"
> graphical_console:
>   protocol:
> - spice
> - vnc
> cloud_init:
>   custom_script: |
> host_name: "{{ vm_fqdn }}"
> user_name: myadmin
> user_password: 
> write_files:
>   - path: /tmp/setup.sh
> permissions: '0755'
> content: |
>   #!/bin/bash
>   echo "$(hostnamectl)" >> /tmp/myhostname.txt
>
>   ipa-client-install --hostname=`hostname -f` \
>   --mkhomedir --domain=services.mydom.internal \
>   --realm=SERVICES.MYDOM.INTERNAL  --no-ntp \
>   --principal=admin --password= \
>   --enable-dns-updates --unattended
> runcmd:
>   - [ /tmp/setup.sh, "{{ vm_fqdn }}" ]
>
> On Wed, Nov 24, 2021 at 9:26 PM Staniforth, Paul 
>  wrote:
>
> Hello Sina,
>
>   to use the template.
>
> Create new VM and select the template.

[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Sina Owolabi
Thanks guys, not sure why the ansible isnt showing up,

Posting again:

- hosts: ovirt.ovirt.mydom.internal
  tasks:
- import_tasks: ovirt_auth.yml

- name: Creates new virtual machine
  ovirt.ovirt.ovirt_vm:
auth: "{{ ovirt_auth }}"
name: "{{ vm_fqdn }}"
state: present
clone: true
cluster: lrg0-ovirt-cluster
storage_domain: lrg0-ovirt-mydom-internal-Local
memory: 16GiB
cpu_cores: 8
cpu_sockets: 2
template: template-test00-centos8
type: server
operating_system: other_linux
sso: true
disk_format: raw
#disks:
#  - name: "{{ vm_fqdn }}-disk0"
#bootable: true
#nics:
#  - name: nic1
#boot_protocol: dhcp
#interface: virtio
#profile_name: "{{ net_profile_name }}"
graphical_console:
  protocol:
- spice
- vnc
cloud_init:
  custom_script: |
host_name: "{{ vm_fqdn }}"
user_name: myadmin
user_password: 
write_files:
  - path: /tmp/setup.sh
permissions: '0755'
content: |
  #!/bin/bash
  echo "$(hostnamectl)" >> /tmp/myhostname.txt

  ipa-client-install --hostname=`hostname -f` \
  --mkhomedir --domain=services.mydom.internal \
  --realm=SERVICES.MYDOM.INTERNAL  --no-ntp \
  --principal=admin --password= \
  --enable-dns-updates --unattended
runcmd:
  - [ /tmp/setup.sh, "{{ vm_fqdn }}" ]

On Fri, Nov 26, 2021 at 5:11 PM Staniforth, Paul <
p.stanifo...@leedsbeckett.ac.uk> wrote:

> Hi Sina,
>  I get easily confused with cloud-init but shouldn't you be
> setting the hostname, username, etc before the custom script?
>
> Also, you could rename the disk as a separate play in your playbook.
>
> e.g.
>
> # Change Disk Name- ovirt.ovirt.ovirt_disk:
> id: ----
> storage_domain: data
> name: "new_disk_name"
> vm_name: rhel7
>
>
> Regards,
>Paul S.
>
> --
> *From:* Sina Owolabi 
> *Sent:* 26 November 2021 15:00
> *To:* Staniforth, Paul 
> *Cc:* users@ovirt.org 
> *Subject:* Re: [ovirt-users] Re: Creating VMs from templates with their
> own disks
>
>
> *Caution External Mail:* Do not click any links or open any attachments
> unless you trust the sender and know that the content is safe.
> Thanks Paul.
>
> I seem to be getting this by hand, but trying with ansible, I think my
> skills are a bit lacking.
> I can create with ansible, and it seems to work well, except for the fact
> that the new vm is
> created with the hostname of the vm from which the template was made.
> The disk is also named by the template.
> My ansiblle yaml is below and I'm pretty sure its wrong (especially where
> it needs to use cloud-init to inject the correct hostname, and the other
> prepping I would like to add).
> Please can you help correct me?
>
> ---
> - hosts: ovirt.ovirt.mydom.internal
>   tasks:
> - import_tasks: ovirt_auth.yml
>
> - name: Creates new virtual machine
>   ovirt.ovirt.ovirt_vm:
> auth: "{{ ovirt_auth }}"
> name: "{{ vm_fqdn }}"
> state: present
> clone: true
> cluster: lrg0-ovirt-cluster
> storage_domain: lrg0-ovirt-mydom-internal-Local
> memory: 16GiB
> cpu_cores: 8
> cpu_sockets: 2
> template: template-test00-centos8
> type: server
> operating_system: other_linux
> sso: true
> disk_format: raw
> #disks:
> #  - name: "{{ vm_fqdn }}-disk0"
> #bootable: true
> #nics:
> #  - name: nic1
> #boot_protocol: dhcp
> #interface: virtio
> #profile_name: "{{ net_profile_name }}"
> graphical_console:
>   protocol:
> - spice
> - vnc
> cloud_init:
>   custom_script: |
> host_name: "{{ vm_fqdn }}"
> user_name: myadmin
> user_password: 
> write_files:
>   - path: /tmp/setup.sh
> permissions: '0755'
> content: |
>   #!/bin/bash
>   echo "$(hostnamectl)" >> /tmp/myhostname.txt
>
>   ipa-client-install --hostname=`hostname -f` \
>   --mkhomedir --domain=services.mydom.internal \
>   --realm=SERVICES.MYDOM.INTERNAL  --no-ntp \
>   --principal=admin --password= \
>   --enable-dns-updates --unattended
> runcmd:
>   - [ /tmp/setup.sh, "{{ vm_fqdn }}" ]
>
> On Wed, Nov 24, 2021 at 9:26 PM Staniforth, Paul <
> p.stanifo...@leedsbeckett.ac.uk> wrote:
>
> Hello Sina,
>
>   to 

[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Staniforth, Paul
Hi Sina,
 I get easily confused with cloud-init but shouldn't you be setting 
the hostname, username, etc before the custom script?

Also, you could rename the disk as a separate play in your playbook.

e.g.

# Change Disk Name
- ovirt.ovirt.ovirt_disk:
id: ----
storage_domain: data
name: "new_disk_name"
vm_name: rhel7

Regards,
   Paul S.


From: Sina Owolabi 
Sent: 26 November 2021 15:00
To: Staniforth, Paul 
Cc: users@ovirt.org 
Subject: Re: [ovirt-users] Re: Creating VMs from templates with their own disks


Caution External Mail: Do not click any links or open any attachments unless 
you trust the sender and know that the content is safe.

Thanks Paul.

I seem to be getting this by hand, but trying with ansible, I think my skills 
are a bit lacking.
I can create with ansible, and it seems to work well, except for the fact that 
the new vm is
created with the hostname of the vm from which the template was made.
The disk is also named by the template.
My ansiblle yaml is below and I'm pretty sure its wrong (especially where it 
needs to use cloud-init to inject the correct hostname, and the other prepping 
I would like to add).
Please can you help correct me?

---
- hosts: ovirt.ovirt.mydom.internal
  tasks:
- import_tasks: ovirt_auth.yml

- name: Creates new virtual machine
  ovirt.ovirt.ovirt_vm:
auth: "{{ ovirt_auth }}"
name: "{{ vm_fqdn }}"
state: present
clone: true
cluster: lrg0-ovirt-cluster
storage_domain: lrg0-ovirt-mydom-internal-Local
memory: 16GiB
cpu_cores: 8
cpu_sockets: 2
template: template-test00-centos8
type: server
operating_system: other_linux
sso: true
disk_format: raw
#disks:
#  - name: "{{ vm_fqdn }}-disk0"
#bootable: true
#nics:
#  - name: nic1
#boot_protocol: dhcp
#interface: virtio
#profile_name: "{{ net_profile_name }}"
graphical_console:
  protocol:
- spice
- vnc
cloud_init:
  custom_script: |
host_name: "{{ vm_fqdn }}"
user_name: myadmin
user_password: 
write_files:
  - path: /tmp/setup.sh
permissions: '0755'
content: |
  #!/bin/bash
  echo "$(hostnamectl)" >> /tmp/myhostname.txt

  ipa-client-install --hostname=`hostname -f` \
  --mkhomedir --domain=services.mydom.internal \
  --realm=SERVICES.MYDOM.INTERNAL  --no-ntp \
  --principal=admin --password= \
  --enable-dns-updates --unattended
runcmd:
  - [ /tmp/setup.sh, "{{ vm_fqdn }}" ]

On Wed, Nov 24, 2021 at 9:26 PM Staniforth, Paul 
mailto:p.stanifo...@leedsbeckett.ac.uk>> wrote:
Hello Sina,

  to use the template.

Create new VM and select the template.

Click the advanced options.

In the boot section you can set the HD to be the first boot devices and 
unselect any CD.
In the Resource Allocation section, you can set the storage allocation to clone 
instead of thin ( this will create a copy of the template disk), you can also 
set the disk alias name.

you can also edit the template to make sure the HD is the first boot device.

I don't know what's in your ansible yaml definition.

Cloning is for copying VMs or snapshots not templates.

Regards,

Paul S.

From: Sina Owolabi mailto:notify.s...@gmail.com>>
Sent: 24 November 2021 09:28
To: Staniforth, Paul 
mailto:p.stanifo...@leedsbeckett.ac.uk>>
Cc: users@ovirt.org 
mailto:users@ovirt.org>>
Subject: Re: [ovirt-users] Re: Creating VMs from templates with their own disks


Caution External Mail: Do not click any links or open any attachments unless 
you trust the sender and know that the content is safe.

Hello

Sorry for the late reply, work has been crazy.

This doesnt seem to work as advertised, or I am still not getting it.
Either way I would really appreciate some help and guidance.

Steps I have attempted:
1. Create and configure VM as I want it to be (disk, partitioning, etc).
2. Shutdown the vm, create a template from it.

Cloning manually:
Cloning fails with this message:
Error while executing action:
clone00.domain.tld:

  *   Cannot add VM. One or more provided storage domains are either not in 
active status or of an illegal type for the requested operation.

I cant modify the storage allocation, and the disk its attempting to use is the 
disk of the source VM.

Manual template install:
Choosing to install manually with a template requires me to add a new disk, and 
to boot off the CD (defined in the template) and manually set things up. This I 
do not wish to do, because I would rather automate.

Cloning with 

[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Strahil Nikolov via Users
I don't seeany Ansible code bellow.
Best Regards,Strahil Nikolov
 
 
  On Fri, Nov 26, 2021 at 17:04, Sina Owolabi wrote:   
___
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/EUSFOOXTU6TXQFD6K5IW4JPVMBF5J7WC/
  
___
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/ZFBMY5NKTZHZSHV5ARF6KDHVSVKTKFHG/


[ovirt-users] Re: Creating VMs from templates with their own disks

2021-11-26 Thread Sina Owolabi
Thanks Paul.

I seem to be getting this by hand, but trying with ansible, I think my
skills are a bit lacking.
I can create with ansible, and it seems to work well, except for the fact
that the new vm is
created with the hostname of the vm from which the template was made.
The disk is also named by the template.
My ansiblle yaml is below and I'm pretty sure its wrong (especially where
it needs to use cloud-init to inject the correct hostname, and the other
prepping I would like to add).
Please can you help correct me?

---
- hosts: ovirt.ovirt.mydom.internal
  tasks:
- import_tasks: ovirt_auth.yml

- name: Creates new virtual machine
  ovirt.ovirt.ovirt_vm:
auth: "{{ ovirt_auth }}"
name: "{{ vm_fqdn }}"
state: present
clone: true
cluster: lrg0-ovirt-cluster
storage_domain: lrg0-ovirt-mydom-internal-Local
memory: 16GiB
cpu_cores: 8
cpu_sockets: 2
template: template-test00-centos8
type: server
operating_system: other_linux
sso: true
disk_format: raw
#disks:
#  - name: "{{ vm_fqdn }}-disk0"
#bootable: true
#nics:
#  - name: nic1
#boot_protocol: dhcp
#interface: virtio
#profile_name: "{{ net_profile_name }}"
graphical_console:
  protocol:
- spice
- vnc
cloud_init:
  custom_script: |
host_name: "{{ vm_fqdn }}"
user_name: myadmin
user_password: 
write_files:
  - path: /tmp/setup.sh
permissions: '0755'
content: |
  #!/bin/bash
  echo "$(hostnamectl)" >> /tmp/myhostname.txt

  ipa-client-install --hostname=`hostname -f` \
  --mkhomedir --domain=services.mydom.internal \
  --realm=SERVICES.MYDOM.INTERNAL  --no-ntp \
  --principal=admin --password= \
  --enable-dns-updates --unattended
runcmd:
  - [ /tmp/setup.sh, "{{ vm_fqdn }}" ]

On Wed, Nov 24, 2021 at 9:26 PM Staniforth, Paul <
p.stanifo...@leedsbeckett.ac.uk> wrote:

> Hello Sina,
>
>   to use the template.
>
> Create new VM and select the template.
>
> Click the advanced options.
>
> In the boot section you can set the HD to be the first boot devices and
> unselect any CD.
> In the Resource Allocation section, you can set the storage allocation to
> clone instead of thin ( this will create a copy of the template disk), you
> can also set the disk alias name.
>
> you can also edit the template to make sure the HD is the first boot
> device.
>
> I don't know what's in your ansible yaml definition.
>
> Cloning is for copying VMs or snapshots not templates.
>
> Regards,
>
> Paul S.
> --
> *From:* Sina Owolabi 
> *Sent:* 24 November 2021 09:28
> *To:* Staniforth, Paul 
> *Cc:* users@ovirt.org 
> *Subject:* Re: [ovirt-users] Re: Creating VMs from templates with their
> own disks
>
>
> *Caution External Mail:* Do not click any links or open any attachments
> unless you trust the sender and know that the content is safe.
> Hello
>
> Sorry for the late reply, work has been crazy.
>
> This doesnt seem to work as advertised, or I am still not getting it.
> Either way I would really appreciate some help and guidance.
>
> Steps I have attempted:
> 1. Create and configure VM as I want it to be (disk, partitioning, etc).
> 2. Shutdown the vm, create a template from it.
>
> Cloning manually:
> Cloning fails with this message:
> Error while executing action:
> clone00.domain.tld:
>
>- Cannot add VM. One or more provided storage domains are either not
>in active status or of an illegal type for the requested operation.
>
> I cant modify the storage allocation, and the disk its attempting to use
> is the disk of the source VM.
>
> Manual template install:
> Choosing to install manually with a template requires me to add a new
> disk, and to boot off the CD (defined in the template) and manually set
> things up. This I do not wish to do, because I would rather automate.
>
> Cloning with ansible, defining the cloud-init script and using the
> template:
> VM is successfully created, but logging in with remote-viewer drops me
> into the installation process (setting up from the attached ISO). Which is
> also not desired.
>
> Please help me with what I am doing wrong.
> Again the goal is to have the vm setup with its own credentials.
>
>
> On Thu, Nov 18, 2021 at 9:24 AM Staniforth, Paul <
> p.stanifo...@leedsbeckett.ac.uk> wrote:
>
> Hello,
>  The VMs can get created from a template otherwise the blank
> template is used if a particular template is used it can be thin dependent
> VM the VMs disks is linked to the Templates disk and it just carries the
> changes made in the VMs disk (this is quicker and uses less space if you a
> lot of 

[ovirt-users] Repository downloads failing checksum

2021-11-26 Thread p . staniforth
Hello,
 When trying to do an update running fails

dnf  update ovirt\*setup\*

Upgrade  4 Packages

Total download size: 338 k
Is this ok [y/N]: y
Downloading Packages:
[MIRROR] ovirt-engine-dwh-grafana-integration-setup-4.4.9.1-1.el8.noarch.rpm: 
Downloading successful, but checksum doesn't match. Calculated: 
4a1410401460e7dd4cb721333fa1b32b971d8d8b199691f957e71dd97c7a60a5(sha256)  
Expected: 
fdbc61cea07dc3f10c683152736a5093c27f7665e95af7e2c90ed78002500b88(sha256) 
[MIRROR] ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch.rpm: Downloading 
successful, but checksum doesn't match. Calculated: 
5fb5af5e5ca5d9dd45e169ad28d91afd4576f4c58fa23b4e326aa7ad4adfe9dc(sha256)  
Expected: 
823f63be1764c561f0378fd7c89b0128a13e1ae916df31b1cdf85de4136dda9f(sha256) 
[MIRROR] ovirt-engine-extension-aaa-ldap-1.4.5-1.el8.noarch.rpm: Downloading 
successful, but checksum doesn't match. Calculated: 
93f6e8aa1b349446fd18d3db42d88df387e4afbae3172cc7b9dc25d8c6b1baf9(sha256)  
Expected: 
b601d9c1e702b8e67ff4c86ab0089c68f0df17fbba2628704821473d17a7320c(sha256) 
[MIRROR] ovirt-engine-dwh-grafana-integration-setup-4.4.9.1-1.el8.noarch.rpm: 
Downloading successful, but checksum doesn't match. Calculated: 
4a1410401460e7dd4cb721333fa1b32b971d8d8b199691f957e71dd97c7a60a5(sha256)  
Expected: 
fdbc61cea07dc3f10c683152736a5093c27f7665e95af7e2c90ed78002500b88(sha256) 
[FAILED] ovirt-engine-dwh-grafana-integration-setup-4.4.9.1-1.el8.noarch.rpm: 
No more mirrors to try - All mirrors were already tried without success 
   
(2-3/4): ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch.rpm  25% 
[==-  ] 444 
kB/s |  88 kB 00:00 ETA
The downloaded packages were saved in cache until the next successful 
transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: Error downloading packages:
  Cannot download 
noarch/ovirt-engine-dwh-grafana-integration-setup-4.4.9.1-1.el8.noarch.rpm: All 
mirrors were tried

I have tried at another site with an up to date system and get

dnf reinstall ovirt-engine-dwh-setup
Total download size: 95 k
Installed size: 214 k
Is this ok [y/N]: y
Downloading Packages:
[MIRROR] ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch.rpm: Downloading 
successful, but checksum doesn't match. Calculated: 
5fb5af5e5ca5d9dd45e169ad28d91afd4576f4c58fa23b4e326aa7ad4adfe9dc(sha256)  
Expected: 
823f63be1764c561f0378fd7c89b0128a13e1ae916df31b1cdf85de4136dda9f(sha256) 
ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch.rpm 

  64 kB/s |  95 kB 00:01
-
Total   

  48 kB/s |  95 kB 00:01 
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing:

 1/1 
  Reinstalling : ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch

 1/2 
  Cleanup  : ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch

 2/2 
  Verifying: ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch

 1/2 
  Verifying: ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch

 2/2 

Reinstalled:
  ovirt-engine-dwh-setup-4.4.9.1-1.el8.noarch   

 

Complete!

Regards,
Paul S.

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