<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello Allen,you can use the old api even if you have ovirt 4, using
    /ovirt-engine/api/v3 as base url. You can do it to earn time to work
    on this without having services not working<br>
    <br>
    Regards<br>
    <br>
    <div class="moz-cite-prefix">On 30/11/16 16:38,
      <a class="moz-txt-link-abbreviated" href="mailto:users-request@ovirt.org">users-request@ovirt.org</a> wrote:<br>
    </div>
    <blockquote cite="mid:mailman.1110.1480534686.1980.users@ovirt.org"
      type="cite">
      <pre wrap="">Send Users mailing list submissions to
        <a class="moz-txt-link-abbreviated" href="mailto:users@ovirt.org">users@ovirt.org</a>

To subscribe or unsubscribe via the World Wide Web, visit
        <a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/users">http://lists.ovirt.org/mailman/listinfo/users</a>
or, via email, send a message with subject or body 'help' to
        <a class="moz-txt-link-abbreviated" href="mailto:users-request@ovirt.org">users-request@ovirt.org</a>

You can reach the person managing the list at
        <a class="moz-txt-link-abbreviated" href="mailto:users-owner@ovirt.org">users-owner@ovirt.org</a>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Users digest..."


Today's Topics:

   1.  Python API ovirtsdk4 cloud-init script file upload        issue
      (Allen Swackhamer)
   2. Re:  Network usage in ovirt dashboard? (Derek Atkins)
   3.  Events not updated in Dashboard after clearing
      (Peter Michael Calum)


----------------------------------------------------------------------

Message: 1
Date: Wed, 30 Nov 2016 12:22:01 -0600
From: Allen Swackhamer <a class="moz-txt-link-rfc2396E" href="mailto:allen.swackhamer@gmail.com">&lt;allen.swackhamer@gmail.com&gt;</a>
To: <a class="moz-txt-link-abbreviated" href="mailto:users@ovirt.org">users@ovirt.org</a>
Subject: [ovirt-users] Python API ovirtsdk4 cloud-init script file
        upload        issue
Message-ID:
        <a class="moz-txt-link-rfc2396E" href="mailto:CAFc20P+c_WYA1VK_P1_gT9AMHa_=q8NPiqjO699XTZmxJwHnAw@mail.gmail.com">&lt;CAFc20P+c_WYA1VK_P1_gT9AMHa_=q8NPiqjO699XTZmxJwHnAw@mail.gmail.com&gt;</a>
Content-Type: text/plain; charset="utf-8"

I am attempting to run a VM with a cloud-init script, but can't seem to get
the syntax working for the python ovirtsdk4 library.  We are running ovirt
4.

My cloud init script never appears to work and the users option does not
work either.  If I use root_password and user_name for types.Initialization
(as in the example below) it will generate the correct users, but if I put
in the types.CloudInit piece it will break it.

types.Initialization(
     user_name=cloud_init_username,
     root_password=cloud_init_password,
     regenerate_ssh_keys=True,
     host_name="testingcloudinit",
     nic_configurations=[
         types.NicConfiguration(
             boot_protocol=types.BootProtocol.DHCP,
             name='ens3',
             on_boot=True
         )
     ],
     custom_script=cloud_init_script
)


What I currently have is below.  cloud_init_script is the script I want to
run as a string.  Looking at the REST API documentation it shows that I
need to upload the file as a CDATA entry, but I am unsure of how I can
ensure that in python.  Is there potentially a way I could get the full XML
call in python to ensure API compliance?

vm_service.start(
    use_cloud_init=True,
    vm=types.Vm(
        initialization=types.Initialization(
            nic_configurations=[types.NicConfiguration(
                boot_protocol=types.BootProtocol.DHCP,
                name="ens3",
                on_boot=True
            )],
            cloud_init=types.CloudInit(
                files=[types.File(
                    name="initialrunner",
                    content=cloud_init_script,
                    type="plaintext"
                ),
                ],
                users=[types.User(
                    user_name=cloud_init_username,
                    password=cloud_init_password
                )]
            )
        )
    )
)

Documentation that I have been using:
<a class="moz-txt-link-freetext" href="http://www.ovirt.org/develop/release-management/features/">http://www.ovirt.org/develop/release-management/features/</a>
cloud/cloud-init-integration/ (seems old and for a earlier ovirtsdk version)
<a class="moz-txt-link-freetext" href="http://cloudinit.readthedocs.io/en/latest/topics/examples">http://cloudinit.readthedocs.io/en/latest/topics/examples</a>.
html#run-commands-on-first-boot (official cloud init documentation)
<a class="moz-txt-link-freetext" href="https://www.mail-archive.com/users@ovirt.org/msg35549.html">https://www.mail-archive.com/users@ovirt.org/msg35549.html</a> (message board
conversation about this REST API)
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/pipermail/users/2014-September/027198.html">http://lists.ovirt.org/pipermail/users/2014-September/027198.html</a> (about
the cloud-init script specifically)
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/pipermail/users/2014-November/028878.html">http://lists.ovirt.org/pipermail/users/2014-November/028878.html</a> (for a old
version of ovirtsdk it appears)
<a class="moz-txt-link-freetext" href="http://www.ovirt.org/develop/api/rest-api/rest-api/#How_">http://www.ovirt.org/develop/api/rest-api/rest-api/#How_</a>
can_I_run_a_custom_script_using_cloud-init.3F (appears to be up to date but
just documents the REST API)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <a class="moz-txt-link-rfc2396E" href="http://lists.ovirt.org/pipermail/users/attachments/20161130/0d8cb8c5/attachment-0001.html">&lt;http://lists.ovirt.org/pipermail/users/attachments/20161130/0d8cb8c5/attachment-0001.html&gt;</a>

------------------------------

Message: 2
Date: Wed, 30 Nov 2016 14:12:28 -0500
From: Derek Atkins <a class="moz-txt-link-rfc2396E" href="mailto:derek@ihtfp.com">&lt;derek@ihtfp.com&gt;</a>
To: Yaniv Dary <a class="moz-txt-link-rfc2396E" href="mailto:ydary@redhat.com">&lt;ydary@redhat.com&gt;</a>
Cc: users <a class="moz-txt-link-rfc2396E" href="mailto:users@ovirt.org">&lt;users@ovirt.org&gt;</a>
Subject: Re: [ovirt-users] Network usage in ovirt dashboard?
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:sjmbmwwbx43.fsf@securerf.ihtfp.org">&lt;sjmbmwwbx43.fsf@securerf.ihtfp.org&gt;</a>
Content-Type: text/plain

Yaniv Dary <a class="moz-txt-link-rfc2396E" href="mailto:ydary@redhat.com">&lt;ydary@redhat.com&gt;</a> writes:

</pre>
      <blockquote type="cite">
        <pre wrap="">It is static and you can't do this.
You can query the DWH database to get this info.
</pre>
      </blockquote>
      <pre wrap="">
Thanks.  I was hoping for an mrtg-style graph.  I suppose I could create
an mrtg instance that measures that data.  It might be an interesting
future extension, especially if mrtg could integrate directly into the
engine database.

I'll take a look (in my copious amounts of free time) and let you know
what I discover.

Is there a good API I could use to query the DWH database for mrtg?

Thanks,

-derek

</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <img src="cid:part1.37EB15B8.7F0A1B54@gmail.com" border="0"></div>
  </body>
</html>