--_000_A266EE4C473A0B4687CFED336548C94101410CE14BLDNEX21Gamesy_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
I have been trying to use the following ansible modules (based on the last =
devel commit in the ansible github repo for the extras modules 43bb97bc3763=
b0335e245606eb2985314902cc91):
* ovirt_vms
* ovirt_disks
I have had varying degrees of success, and I would like to list the followi=
ng issues:
* Through the REST API, I can define multiple nic card configuratio=
ns for cloud-init, however only 1 can be done with Ansible. Also, when usin=
g templates, it automatically assumes I will be using the last version of t=
he template, this had to be defined when using REST.
* Assume I have deployed from a template. This will create a VM wit=
h a disk that is already attached. Now, let's say I want to confirm, or add=
more disks to the VM. If I pass a number of disks, that have already been =
attached, and I reference them by name (in ovirt_disks), I get an error. If=
I do the same operation by ID it seems to work. However I cannot get the I=
D when running ansible, I need to get it from REST. When I query ovirt_vms,=
disk attachments comes up as
o "disk_attachments": [],
If that field gets populated, I could then in turn run ovirt_disks with the=
ID, after querying the VM to get the attachments, but as it is it cannot b=
e done.
I'll give an example
- name: Get Disks
ovirt_disks:
auth: "{{ovirt_auth}}"
vm_name: "{{item.0.name}}"
name: "{{item.1.name}}"
interface: "{{item.1.interface}}"
register: r_disks
with_subelements:
- "{{virtual_machines }}"
- drives
If the drives have already been attached this will fail... =
but
- name: Add Disks to VMs
ovirt_disks:
auth: "{{ovirt_auth}}"
vm_name: "{{item.0.name}}"
id: 8fc2811e-7774-4903-a5b3-489fdedb377b
size: "100GiB"
format: "{{item.1.format}}"
storage_domain: "{{item.1.storage_domain.name}}"
bootable: "{{item.1.bootable}}"
interface: "{{item.1.interface}}"
state: attached
with_subelements:
- "{{virtual_machines }}"
- drives
The second example is working, even if the disk has already=
been attached.
I'm assuming that since I'm creating the VM from a template, there might be=
multiple disks with the same name, and the wrong ID is being retrieved.
I'm happy to do more testing as further commits appear.
Regards,
Jean Paul Gatt
This email (including any attachments) is confidential, protected by copyri=
ght and/or other intellectual property rights and may be privileged. If you=
have received it in error, please notify the sender immediately before del=
eting the email from your device. Do not use, copy or disclose the informat=
ion contained in this message or in any attachment. We accept no responsibi=
lity for malware that we may have unintentionally transmitted to you within=
this email. Those communicating with us by email will be deemed to have co=
nsented to us intercepting and monitoring those communications. Gamesys Net=
work Ltd is registered in Malta, with company registration number C47555 an=
d VAT registered number MT19542837. The registered office is at Capital Bus=
iness Centre, Entrance A, Level 1, Taz-Zwejt Street, San Gwann SGN3000.
--_000_A266EE4C473A0B4687CFED336548C94101410CE14BLDNEX21Gamesy_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml"
xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word"
=
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml"
xmlns=3D"http:=
//www.w3.org/TR/REC-html40"
<head
<meta http-equiv=3D"Content-Type"
content=3D"text/html; charset=3Dus-ascii"=
<meta name=3D"Generator" content=3D"Microsoft
Word 15 (filtered medium)"
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1849564149;
mso-list-type:hybrid;
mso-list-template-ids:-1771529520 -610110070 134807555 134807557 134807553=
134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /
</xml><![endif]--><!--[if gte mso
9]><xml
<o:shapelayout
v:ext=3D"edit"
<o:idmap v:ext=3D"edit"
data=3D"1" /
</o:shapelayout></xml><![endif]--
</head
<body lang=3D"EN-GB"
link=3D"#0563C1" vlink=3D"#954F72"
<div
class=3D"WordSection1"
<p
class=3D"MsoNormal">Hi,<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p class=3D"MsoNormal">I have been trying to
use the following ansible modu=
les (based on the last devel commit in the ansible github repo for the extr=
as modules 43bb97bc3763b0335e245606eb2985314902cc91):<o:p></o:p></p
<p class=3D"MsoListParagraph"
style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo1"><![if !supportLists]><span
style=3D"font-family:Symbol"><span styl=
e=3D"mso-list:Ignore">·<span style=3D"font:7.0pt
"Times New Rom=
an"">
</span></span></span><![endif]>ovirt_vms<o:p></o:p></p
<p class=3D"MsoListParagraph"
style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo1"><![if !supportLists]><span
style=3D"font-family:Symbol"><span styl=
e=3D"mso-list:Ignore">·<span style=3D"font:7.0pt
"Times New Rom=
an"">
</span></span></span><![endif]>ovirt_disks<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p class=3D"MsoNormal">I have had varying
degrees of success, and I would l=
ike to list the following issues:<o:p></o:p></p
<p class=3D"MsoListParagraph"
style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo1"><![if !supportLists]><span
style=3D"font-family:Symbol"><span styl=
e=3D"mso-list:Ignore">·<span style=3D"font:7.0pt
"Times New Rom=
an"">
</span></span></span><![endif]>Through the REST API, I can define
multiple =
nic card configurations for cloud-init, however only 1 can be done with Ans=
ible. Also, when using templates, it automatically assumes I will be using =
the last version of the template,
this had to be defined when using REST.<o:p></o:p></p
<p class=3D"MsoListParagraph"
style=3D"text-indent:-18.0pt;mso-list:l0 leve=
l1 lfo1"><![if !supportLists]><span
style=3D"font-family:Symbol"><span styl=
e=3D"mso-list:Ignore">·<span style=3D"font:7.0pt
"Times New Rom=
an"">
</span></span></span><![endif]>Assume I have deployed from a
template. This=
will create a VM with a disk that is already attached. Now, let’s sa=
y I want to confirm, or add more disks to the VM. If I pass a number of dis=
ks, that have already been attached, and
I reference them by name (in ovirt_disks), I get an error. If I do the sam=
e operation by ID it seems to work. However I cannot get the ID when runnin=
g ansible, I need to get it from REST. When I query ovirt_vms, disk attachm=
ents comes up as
<o:p></o:p></p
<p
class=3D"MsoListParagraph" style=3D"margin-left:72.0pt;text-indent:-18.0=
pt;mso-list:l0 level2 lfo1"
<![if !supportLists]><span
style=3D"font-family:"Courier New""><s=
pan style=3D"mso-list:Ignore">o<span style=3D"font:7.0pt
"Times New Ro=
man"">
</span></span></span><![endif]>"disk_attachments":
[],<o:p></o:p>=
</p
<p class=3D"MsoListParagraph">If that field
gets populated, I could then in=
turn run ovirt_disks with the ID, after querying the VM to get the attachm=
ents, but as it is it cannot be done.<o:p></o:p></p
<p
class=3D"MsoListParagraph"><o:p> </o:p></p
<p class=3D"MsoListParagraph">I’ll
give an example<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p class=3D"MsoNormal">- name: Get
Disks<o:p></o:p></p
<p
class=3D"MsoNormal"> ovirt_disks:<o:p></o:p></p
<p
class=3D"MsoNormal"> auth:
"{{ovirt_auth}}"<=
o:p></o:p></p
<p
class=3D"MsoNormal"> vm_name:
"{{item.0.name}}&qu=
ot;<o:p></o:p></p
<p
class=3D"MsoNormal"> name:
"{{item.1.name}}"=
<o:p></o:p></p
<p
class=3D"MsoNormal"> interface:
"{{item.1.interfa=
ce}}"<o:p></o:p></p
<p
class=3D"MsoNormal"> register:
r_disks<o:p></o:p></p
<p
class=3D"MsoNormal">
with_subelements:<o:p></o:p></p
<p
class=3D"MsoNormal"> -
"{{virtual_machines }}&quo=
t;<o:p></o:p></p
<p
class=3D"MsoNormal"> -
drives<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p
class=3D"MsoNormal"> &nbs=
p; If the drives have already
been atta=
ched this will fail… but<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p class=3D"MsoNormal">- name: Add Disks to
VMs<o:p></o:p></p
<p
class=3D"MsoNormal"> ovirt_disks:<o:p></o:p></p
<p
class=3D"MsoNormal"> auth:
"{{ovirt_auth}}"<=
o:p></o:p></p
<p
class=3D"MsoNormal"> vm_name:
"{{item.0.name}}&qu=
ot;<o:p></o:p></p
<p
class=3D"MsoNormal"> id:
8fc2811e-7774-4903-a5b3-489fd=
edb377b<o:p></o:p></p
<p
class=3D"MsoNormal"> size:
"100GiB"<o:p></o:=
p></p
<p
class=3D"MsoNormal"> format:
"{{item.1.format}}&q=
uot;<o:p></o:p></p
<p
class=3D"MsoNormal"> storage_domain:
"{{item.1.st=
orage_domain.name}}"<o:p></o:p></p
<p
class=3D"MsoNormal"> bootable:
"{{item.1.bootable=
}}"<o:p></o:p></p
<p
class=3D"MsoNormal"> interface:
"{{item.1.interfa=
ce}}"<o:p></o:p></p
<p
class=3D"MsoNormal"> state:
attached<o:p></o:p></p
<p
class=3D"MsoNormal">
with_subelements:<o:p></o:p></p
<p
class=3D"MsoNormal"> -
"{{virtual_machines }}&quo=
t;<o:p></o:p></p
<p
class=3D"MsoNormal"> -
drives<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p
class=3D"MsoNormal"> &nbs=
p; The second example is
working, even =
if the disk has already been attached.<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p class=3D"MsoNormal">I’m assuming
that since I’m creating the=
VM from a template, there might be multiple disks with the same name, and =
the wrong ID is being retrieved.
<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p class=3D"MsoNormal">I’m happy to
do more testing as further commit=
s appear.<o:p></o:p></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
<p class=3D"MsoNormal"><span
style=3D"mso-fareast-language:EN-GB">Regards<b=
>,<o:p></o:p></b></span></p
<p
class=3D"MsoNormal"><b><span
style=3D"mso-fareast-language:EN-GB"><o:p>&=
nbsp;</o:p></span></b></p
<p
class=3D"MsoNormal"><b><span
style=3D"color:#C00000;mso-fareast-language=
:EN-GB">Jean Paul Gatt</span></b><span
style=3D"color:black;mso-fareast-lan=
guage:EN-GB"><br
<br
</span><span
style=3D"font-size:6.0pt;color:gray;mso-fareast-language:EN-GB=
"><o:p></o:p></span></p
<p
class=3D"MsoNormal"><o:p> </o:p></p
</div
<br
<span
style=3D"font-size:6.0pt; font-family:"Arial","sans-se=
rif"; color:gray">This email (including any attachments) is confidenti=
al, protected by copyright and/or other intellectual property rights and ma=
y be privileged. If you have received it in error, please
notify the sender immediately before deleting the email from your device. =
Do not use, copy or disclose the information contained in this message or i=
n any attachment. We accept no responsibility for malware that we may have =
unintentionally transmitted to you
within this email. Those communicating with us by email will be deemed to =
have consented to us intercepting and monitoring those communications. Game=
sys Network Ltd is registered in Malta, with company registration number C4=
7555 and VAT registered number MT19542837.
The registered office is at Capital Business Centre, Entrance A, Level 1, =
Taz-Zwejt Street, San Gwann SGN3000.
</span
</body
</html
--_000_A266EE4C473A0B4687CFED336548C94101410CE14BLDNEX21Gamesy_--