<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 04/09/2014 06:56 AM, Sheldon wrote:<br>
    </div>
    <blockquote cite="mid:5345193F.6020705@linux.vnet.ibm.com"
      type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Then about the API.<br>
        define one API but with a filter parameters as follow:<br>
        <br>
        <br>
        --- a/docs/API.md<br>
        +++ b/docs/API.md<br>
        @@ -102,7 +102,9 @@ the following general conventions:<br>
        &nbsp;**Actions (POST):**<br>
        &nbsp;<br>
        &nbsp;* start: Power on a VM<br>
        -* stop: Power off forcefully<br>
        +* stop: Power off a VM<br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * grace *(optional)*: If 'true', Power off a VM
        gracefully,<br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; or Power off a VM forcefully.<br>
        &nbsp;* connect: Prepare the connection for spice or vnc<br>
        &nbsp;<br>
        &nbsp;### Sub-resource: Virtual Machine Screenshot<br>
        <br>
        <br>
        or add a new rest API for acpi shutdown?<br>
        --- a/docs/API.md<br>
        +++ b/docs/API.md<br>
        @@ -103,6 +103,8 @@ the following general conventions:<br>
        &nbsp;<br>
        &nbsp;* start: Power on a VM<br>
        &nbsp;* stop: Power off forcefully<br>
        +* shutdown: Shutdown a VM gracefully.<br>
        +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note that the guest OS may ignore the request. <br>
        &nbsp;* connect: Prepare the connection for spice or vnc<br>
        &nbsp; <br>
      </div>
    </blockquote>
    <br>
    how about: stop (for shutdown graceful) and forceoff<br>
    <br>
    <blockquote cite="mid:5345193F.6020705@linux.vnet.ibm.com"
      type="cite">
      <div class="moz-cite-prefix"> &nbsp;### Sub-resource: Virtual Machine
        Screenshot<br>
        <br>
        <br>
        <br>
        On 04/09/2014 03:54 AM, Paulo Ricardo Paz Vital wrote:<br>
      </div>
      <blockquote cite="mid:1396986874.2160.5.camel@hornet.br.ibm.com"
        type="cite">
        <div class="moz-text-plain" wrap="true" graphical-quote="true"
          style="font-family: -moz-fixed; font-size: 12px;"
          lang="x-western">
          <pre wrap="">+1 for option 2
<div class="moz-txt-sig">-- 
Paulo Ricardo Paz Vital <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:pvital@linux.vnet.ibm.com">&lt;pvital@linux.vnet.ibm.com&gt;</a>
IBM Linux Technology Center

On Tue, 2014-04-08 at 15:00 -0300, Aline Manera wrote:
</div></pre>
          <blockquote type="cite" style="color: #000000;">
            <pre wrap=""><span class="moz-txt-citetags">&gt; </span>My vote is for option 2 too
<span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>On 04/08/2014 12:57 PM, Adam King wrote:
</pre>
            <blockquote type="cite" style="color: #000000;">
              <pre wrap=""><span class="moz-txt-citetags">&gt; &gt; </span>I would recommend option 2: "shutdown" and "power off"
<span class="moz-txt-citetags">&gt; &gt;</span>
<span class="moz-txt-citetags">&gt; &gt; </span>On 4/8/2014 11:21 AM, Sheldon wrote:
</pre>
              <blockquote type="cite" style="color: #000000;">
                <pre wrap=""><span class="moz-txt-citetags">&gt; &gt;&gt; </span>Currently, stopping guests in Kimchi is not graceful in the sense 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>that the guest becomes 'shut down' immediately. This could be be 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>problematic because guest file systems could become corrupted. 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>Perhaps a warning should be added before a guest is immediately 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>stopped or reset.
<span class="moz-txt-citetags">&gt; &gt;&gt;</span>
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>kimchi can does not support shutdown by agent, so we can not 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>guarantee we can shutdown graceful.
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>User should install agent manully
<span class="moz-txt-citetags">&gt; &gt;&gt;</span>
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>We can use acpi shutdown a VM. But not all guest os will shutdown the 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>VM even it receive acpi shutdown.
<span class="moz-txt-citetags">&gt; &gt;&gt;</span>
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>So I have 2 proposal:
<span class="moz-txt-citetags">&gt; &gt;&gt;</span>
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>1. only one shutdown API and one shutdown button for UI.
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>when user click shutdown, the backend will try to shutdown VM by acpi.
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>if 1 minutes timeout, kimchi will destroy the VM forcefully.
<span class="moz-txt-citetags">&gt; &gt;&gt;</span>
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>2. support ACPI shutdown and destroy two APIs. support "force off" 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>and "shutdown" 2 buttons in UI.
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>"shutdown" means ACPI shutdown. but we can not guarantee it can 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>shutdown the VM.
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>If the user find the VM is not shutdown for some time, he can try to 
<span class="moz-txt-citetags">&gt; &gt;&gt; </span>force power off the VM
<span class="moz-txt-citetags">&gt; &gt;&gt;</span>
<span class="moz-txt-citetags">&gt; &gt;&gt;</span>
</pre>
              </blockquote>
              <pre wrap=""><span class="moz-txt-citetags">&gt; &gt;</span>
</pre>
            </blockquote>
            <pre wrap=""><span class="moz-txt-citetags">&gt; </span>
<span class="moz-txt-citetags">&gt; </span>_______________________________________________
<span class="moz-txt-citetags">&gt; </span>Kimchi-devel mailing list
<span class="moz-txt-citetags">&gt; </span><a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<span class="moz-txt-citetags">&gt; </span><a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
<span class="moz-txt-citetags">&gt; </span>
</pre>
          </blockquote>
          <pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>



</pre>
        </div>
      </blockquote>
      <br>
      <br>
      <pre class="moz-signature" cols="72">-- 
Thanks and best regards!

Sheldon Feng(&#20911;&#23569;&#21512;)<a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:shaohef@linux.vnet.ibm.com">&lt;shaohef@linux.vnet.ibm.com&gt;</a>
IBM Linux Technology Center</pre>
    </blockquote>
    <br>
  </body>
</html>