Discussion:
[ovirt-users] Ovirt 4.4.6.8-1 upload ova as template to multiple hosts
Don Dupuis
2021-05-20 04:18:54 UTC
Permalink
I have a single ovirt manager and 2 ovirt hosts, each has a local storage
domain. I am using the upload_ova_as_template.py and my template upload
works on a single host but not both. If I use the gui method, there is the
option of "clone" and putting in a new name for the template. This seems to
work most of the time, but it has failed a couple of times also. I would
like to add the same "clone" and "name" option to the
upload_ova_as_temple.py. What is the best way to do this since I need to
have unique UUIDs for the template disks? This is a unique setup in the
fact that I can't use shared storage and this should be doable as I was
able to do it in the ovirt gui.

Thanks
Don
Don Dupuis
2021-05-24 15:47:37 UTC
Permalink
Nudging to see if anyone has experience with this?

Don
Post by Don Dupuis
I have a single ovirt manager and 2 ovirt hosts, each has a local storage
domain. I am using the upload_ova_as_template.py and my template upload
works on a single host but not both. If I use the gui method, there is the
option of "clone" and putting in a new name for the template. This seems to
work most of the time, but it has failed a couple of times also. I would
like to add the same "clone" and "name" option to the
upload_ova_as_temple.py. What is the best way to do this since I need to
have unique UUIDs for the template disks? This is a unique setup in the
fact that I can't use shared storage and this should be doable as I was
able to do it in the ovirt gui.
Thanks
Don
Arik Hadas
2021-05-24 19:51:25 UTC
Permalink
Post by Don Dupuis
Nudging to see if anyone has experience with this?
Don
Post by Don Dupuis
I have a single ovirt manager and 2 ovirt hosts, each has a local storage
domain. I am using the upload_ova_as_template.py and my template upload
works on a single host but not both. If I use the gui method, there is the
option of "clone" and putting in a new name for the template. This seems to
work most of the time, but it has failed a couple of times also. I would
like to add the same "clone" and "name" option to the
upload_ova_as_temple.py. What is the best way to do this since I need to
have unique UUIDs for the template disks? This is a unique setup in the
fact that I can't use shared storage and this should be doable as I was
able to do it in the ovirt gui.
If it's just a one-time operation, I'd rather try to create a VM out of the
template that was imported successfully (with disk-provisioning = clone),
create a second template out of it, remove the original template and then
upload the template from the OVA to the other storage domain.

Changing the script to obtain import as clone is also possible but it
requires some programming skills - you'd need to either generate or provide
the script with different name for the template and UUIDs for the disks and
then (1) use the new UUIDs when uploading the disks and (2) change the OVF
that is loaded from the OVA to have the new name and UUIDs before providing
the OVF to the engine.
Post by Don Dupuis
Post by Don Dupuis
Thanks
Don
_______________________________________________
Privacy Statement: https://www.ovirt.org/privacy-policy.html
https://www.ovirt.org/community/about/community-guidelines/
Don Dupuis
2021-05-24 20:56:33 UTC
Permalink
Arik
Thanks for the info. My simple setup is just a base for bigger clusters
that I have to do and there will be multiple templates that I need to
install. I have python programming skills but just needed some simple
pointing in the right direction on where to make the addition changes to
the code. It takes a little bit of time to get the services and types
correct for what you want to accomplish and how it is implemented.

Don
Post by Arik Hadas
Post by Don Dupuis
Nudging to see if anyone has experience with this?
Don
Post by Don Dupuis
I have a single ovirt manager and 2 ovirt hosts, each has a local
storage domain. I am using the upload_ova_as_template.py and my template
upload works on a single host but not both. If I use the gui method, there
is the option of "clone" and putting in a new name for the template. This
seems to work most of the time, but it has failed a couple of times also. I
would like to add the same "clone" and "name" option to the
upload_ova_as_temple.py. What is the best way to do this since I need to
have unique UUIDs for the template disks? This is a unique setup in the
fact that I can't use shared storage and this should be doable as I was
able to do it in the ovirt gui.
If it's just a one-time operation, I'd rather try to create a VM out of
the template that was imported successfully (with disk-provisioning =
clone), create a second template out of it, remove the original template
and then upload the template from the OVA to the other storage domain.
Changing the script to obtain import as clone is also possible but it
requires some programming skills - you'd need to either generate or provide
the script with different name for the template and UUIDs for the disks and
then (1) use the new UUIDs when uploading the disks and (2) change the OVF
that is loaded from the OVA to have the new name and UUIDs before providing
the OVF to the engine.
Post by Don Dupuis
Post by Don Dupuis
Thanks
Don
_______________________________________________
Privacy Statement: https://www.ovirt.org/privacy-policy.html
https://www.ovirt.org/community/about/community-guidelines/
Don Dupuis
2021-05-27 13:24:39 UTC
Permalink
Arik
Just to say thank you again for the pointers on what was needed to be done.
I was able to modify that script to do what was needed and now it works
like a champ.

Thanks
Don
Post by Don Dupuis
Arik
Thanks for the info. My simple setup is just a base for bigger clusters
that I have to do and there will be multiple templates that I need to
install. I have python programming skills but just needed some simple
pointing in the right direction on where to make the addition changes to
the code. It takes a little bit of time to get the services and types
correct for what you want to accomplish and how it is implemented.
Don
Post by Arik Hadas
Post by Don Dupuis
Nudging to see if anyone has experience with this?
Don
Post by Don Dupuis
I have a single ovirt manager and 2 ovirt hosts, each has a local
storage domain. I am using the upload_ova_as_template.py and my template
upload works on a single host but not both. If I use the gui method, there
is the option of "clone" and putting in a new name for the template. This
seems to work most of the time, but it has failed a couple of times also. I
would like to add the same "clone" and "name" option to the
upload_ova_as_temple.py. What is the best way to do this since I need to
have unique UUIDs for the template disks? This is a unique setup in the
fact that I can't use shared storage and this should be doable as I was
able to do it in the ovirt gui.
If it's just a one-time operation, I'd rather try to create a VM out of
the template that was imported successfully (with disk-provisioning =
clone), create a second template out of it, remove the original template
and then upload the template from the OVA to the other storage domain.
Changing the script to obtain import as clone is also possible but it
requires some programming skills - you'd need to either generate or provide
the script with different name for the template and UUIDs for the disks and
then (1) use the new UUIDs when uploading the disks and (2) change the OVF
that is loaded from the OVA to have the new name and UUIDs before providing
the OVF to the engine.
Post by Don Dupuis
Post by Don Dupuis
Thanks
Don
_______________________________________________
Privacy Statement: https://www.ovirt.org/privacy-policy.html
https://www.ovirt.org/community/about/community-guidelines/
Arik Hadas
2021-05-27 14:34:53 UTC
Permalink
Post by Don Dupuis
Arik
Just to say thank you again for the pointers on what was needed to be
done. I was able to modify that script to do what was needed and now it
works like a champ.
Awesome, glad to hear that.
Looking again at what you wrote below, you've mentioned the script is named
upload_ova_as_template.py. We've made some changes to that script and
renamed it to upload_ova_as_vm_or_template.py [1]. It would be great if you
could contribute your changes to it

[1]
https://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=blob;f=sdk/examples/upload_ova_as_vm_or_template.py;h=d6f40548b912577dc18a24d564f37d117a084d28;hb=HEAD
Post by Don Dupuis
Thanks
Don
Post by Don Dupuis
Arik
Thanks for the info. My simple setup is just a base for bigger clusters
that I have to do and there will be multiple templates that I need to
install. I have python programming skills but just needed some simple
pointing in the right direction on where to make the addition changes to
the code. It takes a little bit of time to get the services and types
correct for what you want to accomplish and how it is implemented.
Don
Post by Arik Hadas
Post by Don Dupuis
Nudging to see if anyone has experience with this?
Don
Post by Don Dupuis
I have a single ovirt manager and 2 ovirt hosts, each has a local
storage domain. I am using the upload_ova_as_template.py and my template
upload works on a single host but not both. If I use the gui method, there
is the option of "clone" and putting in a new name for the template. This
seems to work most of the time, but it has failed a couple of times also. I
would like to add the same "clone" and "name" option to the
upload_ova_as_temple.py. What is the best way to do this since I need to
have unique UUIDs for the template disks? This is a unique setup in the
fact that I can't use shared storage and this should be doable as I was
able to do it in the ovirt gui.
If it's just a one-time operation, I'd rather try to create a VM out of
the template that was imported successfully (with disk-provisioning =
clone), create a second template out of it, remove the original template
and then upload the template from the OVA to the other storage domain.
Changing the script to obtain import as clone is also possible but it
requires some programming skills - you'd need to either generate or provide
the script with different name for the template and UUIDs for the disks and
then (1) use the new UUIDs when uploading the disks and (2) change the OVF
that is loaded from the OVA to have the new name and UUIDs before providing
the OVF to the engine.
Post by Don Dupuis
Post by Don Dupuis
Thanks
Don
_______________________________________________
Privacy Statement: https://www.ovirt.org/privacy-policy.html
https://www.ovirt.org/community/about/community-guidelines/
Don Dupuis
2021-05-27 15:19:07 UTC
Permalink
It is the same script, I just renamed it. Now what I did works but it isn't
the proper way to do it. I want to improve it before contributing it as I
write the ovf data back out to a file and use pythons sed like
functionality to modify the file and then read in the updated one to give
to the engine. I just wanted to get something to work to get my project
done.

Don
Post by Arik Hadas
Post by Don Dupuis
Arik
Just to say thank you again for the pointers on what was needed to be
done. I was able to modify that script to do what was needed and now it
works like a champ.
Awesome, glad to hear that.
Looking again at what you wrote below, you've mentioned the script is
named upload_ova_as_template.py. We've made some changes to that script and
renamed it to upload_ova_as_vm_or_template.py [1]. It would be great if you
could contribute your changes to it
[1]
https://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=blob;f=sdk/examples/upload_ova_as_vm_or_template.py;h=d6f40548b912577dc18a24d564f37d117a084d28;hb=HEAD
Post by Don Dupuis
Thanks
Don
Post by Don Dupuis
Arik
Thanks for the info. My simple setup is just a base for bigger clusters
that I have to do and there will be multiple templates that I need to
install. I have python programming skills but just needed some simple
pointing in the right direction on where to make the addition changes to
the code. It takes a little bit of time to get the services and types
correct for what you want to accomplish and how it is implemented.
Don
Post by Arik Hadas
Post by Don Dupuis
Nudging to see if anyone has experience with this?
Don
Post by Don Dupuis
I have a single ovirt manager and 2 ovirt hosts, each has a local
storage domain. I am using the upload_ova_as_template.py and my template
upload works on a single host but not both. If I use the gui method, there
is the option of "clone" and putting in a new name for the template. This
seems to work most of the time, but it has failed a couple of times also. I
would like to add the same "clone" and "name" option to the
upload_ova_as_temple.py. What is the best way to do this since I need to
have unique UUIDs for the template disks? This is a unique setup in the
fact that I can't use shared storage and this should be doable as I was
able to do it in the ovirt gui.
If it's just a one-time operation, I'd rather try to create a VM out of
the template that was imported successfully (with disk-provisioning =
clone), create a second template out of it, remove the original template
and then upload the template from the OVA to the other storage domain.
Changing the script to obtain import as clone is also possible but it
requires some programming skills - you'd need to either generate or provide
the script with different name for the template and UUIDs for the disks and
then (1) use the new UUIDs when uploading the disks and (2) change the OVF
that is loaded from the OVA to have the new name and UUIDs before providing
the OVF to the engine.
Post by Don Dupuis
Post by Don Dupuis
Thanks
Don
_______________________________________________
Privacy Statement: https://www.ovirt.org/privacy-policy.html
https://www.ovirt.org/community/about/community-guidelines/
Arik Hadas
2021-05-27 15:48:52 UTC
Permalink
Post by Don Dupuis
It is the same script, I just renamed it. Now what I did works but it
isn't the proper way to do it. I want to improve it before contributing it
as I write the ovf data back out to a file and use pythons sed like
functionality to modify the file and then read in the updated one to give
to the engine. I just wanted to get something to work to get my project
done.
Ack, yeah, it makes sense to change that.
I don't know if you've added an argument to the script that determines
whether or not the entity is imported as a clone, but it can also be handy
to import as a clone automatically when a VM/template with the same ID
already exists. That's something we used to do when importing from export
domains and we miss it for uploading from OVA.
Post by Don Dupuis
Don
Post by Arik Hadas
Post by Don Dupuis
Arik
Just to say thank you again for the pointers on what was needed to be
done. I was able to modify that script to do what was needed and now it
works like a champ.
Awesome, glad to hear that.
Looking again at what you wrote below, you've mentioned the script is
named upload_ova_as_template.py. We've made some changes to that script and
renamed it to upload_ova_as_vm_or_template.py [1]. It would be great if you
could contribute your changes to it
[1]
https://gerrit.ovirt.org/gitweb?p=ovirt-engine-sdk.git;a=blob;f=sdk/examples/upload_ova_as_vm_or_template.py;h=d6f40548b912577dc18a24d564f37d117a084d28;hb=HEAD
Post by Don Dupuis
Thanks
Don
Post by Don Dupuis
Arik
Thanks for the info. My simple setup is just a base for bigger clusters
that I have to do and there will be multiple templates that I need to
install. I have python programming skills but just needed some simple
pointing in the right direction on where to make the addition changes to
the code. It takes a little bit of time to get the services and types
correct for what you want to accomplish and how it is implemented.
Don
Post by Arik Hadas
Post by Don Dupuis
Nudging to see if anyone has experience with this?
Don
Post by Don Dupuis
I have a single ovirt manager and 2 ovirt hosts, each has a local
storage domain. I am using the upload_ova_as_template.py and my template
upload works on a single host but not both. If I use the gui method, there
is the option of "clone" and putting in a new name for the template. This
seems to work most of the time, but it has failed a couple of times also. I
would like to add the same "clone" and "name" option to the
upload_ova_as_temple.py. What is the best way to do this since I need to
have unique UUIDs for the template disks? This is a unique setup in the
fact that I can't use shared storage and this should be doable as I was
able to do it in the ovirt gui.
If it's just a one-time operation, I'd rather try to create a VM out
of the template that was imported successfully (with disk-provisioning =
clone), create a second template out of it, remove the original template
and then upload the template from the OVA to the other storage domain.
Changing the script to obtain import as clone is also possible but it
requires some programming skills - you'd need to either generate or provide
the script with different name for the template and UUIDs for the disks and
then (1) use the new UUIDs when uploading the disks and (2) change the OVF
that is loaded from the OVA to have the new name and UUIDs before providing
the OVF to the engine.
Post by Don Dupuis
Post by Don Dupuis
Thanks
Don
_______________________________________________
Privacy Statement: https://www.ovirt.org/privacy-policy.html
https://www.ovirt.org/community/about/community-guidelines/
Loading...