Hi,<br><br>As you pointed out, your client program has to copy or create the file, and then enable the image.<br>The command oneimage already does that. You may want to check it (the binary executable is actually a ruby script) and ImageRepository.rb<br>

<br>Regards<br clear="all"><span style="border-collapse:collapse;color:rgb(136, 136, 136);font-family:arial, sans-serif;font-size:13px">--<br>Carlos Martín, MSc<br>Project Major Contributor<br><span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">OpenNebula</span> - The Open Source Toolkit for Cloud Computing<br>

<a href="http://www.opennebula.org/" style="color:rgb(42, 93, 176)" target="_blank">www.<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">OpenNebula</span>.org</a> | <a href="mailto:cmartin@opennebula.org" style="color:rgb(42, 93, 176)" target="_blank">cmartin@<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">opennebula</span>.org</a></span><br>


<br><br><div class="gmail_quote">2011/3/30 liudewei <span dir="ltr"><<a href="mailto:liudewei@neusoft.com">liudewei@neusoft.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">





<div style="font-size:10pt;font-family:verdana">
<div><font face="Verdana" size="2">
<div><font face="Verdana" size="2">
<div><font face="Verdana" size="2">Hi,All</font></div>
<div> </div>
<div style="text-indent:2em">When I call 
“one.image.allocate” of  xml-rpc API 
,the new image file can't be created .</div>
<div style="text-indent:2em">but,oneimage register is no problem!</div>
<div style="text-indent:2em"> </div>
<div style="text-indent:2em"> oneimage list command follows:</div>
<div style="text-indent:2em"> </div>
<div style="text-indent:2em"><font face="Verdana" size="2"> 35 oneadmin         0328_mkImg_1   OS   Mar 28, 2011 02:12 Yes  No disa     0 
</font></div>
<div style="text-indent:2em"></div>
<div style="text-indent:2em"> oneimage show 35 follows</div>
<div style="text-indent:6em"><font style="background-color:#99ccff">IMAGE  INFORMATION                                                              </font></div>
<blockquote dir="ltr" style="margin-right:0px">
  <blockquote style="text-indent:2em">
    <div><font style="background-color:#99ccff">ID             : 35                  </font></div>
    <div><font style="background-color:#99ccff">NAME           : 0328_mkImg_1        </font></div>
    <div><font style="background-color:#99ccff">TYPE           : OS                  </font></div>
    <div><font style="background-color:#99ccff">REGISTER TIME  : 03/28 10:12:57      </font></div>
    <div><font style="background-color:#99ccff">PUBLIC         : Yes                 </font></div>
    <div><font style="background-color:#99ccff">PERSISTENT     : No                  </font></div>
    <div><font style="background-color:#ffff00">SOURCE         : /opt/nebula/images/afa5ebb70546e3786197e607b4092f1e13c5a5e4</font></div>
    <div><font style="background-color:#99ccff">STATE          : disa                </font></div>
    <div><font style="background-color:#99ccff">RUNNING_VMS    : 0                   </font></div>
    <div><font style="background-color:#99ccff"></font></div>
    <div><font style="background-color:#99ccff">IMAGE TEMPLATE                                                                  </font></div>
    <div><font style="background-color:#99ccff">DESCRIPTION=0328_mkImg_1 desc</font></div>
    <div><font style="background-color:#99ccff">DEV_PREFIX=hd</font></div>
    <div><font style="background-color:#99ccff">NAME=0328_mkImg_1</font></div>
    <div><font style="background-color:#99ccff">PATH=/one_images/8/images/disk.0</font></div>
    <div><font style="background-color:#99ccff">TYPE=OS</font></div></blockquote></blockquote>
<div style="text-indent:2em">  </div>
<div style="text-indent:2em">The file path to <font style="background-color:#ffff00">SOURCE  </font><font>Attribute,but 
the actual file isn't generated!</font></div>
<div style="text-indent:2em"> </div>
<div style="text-indent:2em">My java project code the following:</div>
<blockquote dir="ltr" style="text-indent:2em;margin-right:0px">
  <div>StringBuffer template = new StringBuffer();</div>
  <blockquote dir="ltr" style="margin-right:0px">
    <div>template.append("NAME=").append("\"").append(name).append("\"").append("\n"); </div>
    <div>template.append("DESCRIPTION=").append("\"").append(desc).append("\"").append("\n");</div>
    <div>template.append("PUBLIC = ").append("YES").append("\n"); </div>
    <div>template.append("TYPE=").append("OS").append("\n"); </div>
    <div>template.append("PERSISTENT=").append("NO").append("\n"); </div>
    <div>template.append("DEV_PREFIX=").append("\"hd\"").append("\n"); // 可选. </div>
    <div>//template.append("BUS=").append("").append("\n"); </div>
    <div>template.append("PATH=").append("/one_images/").append(vminfo.getVmId()).append("/images/disk.0").append("\n"); </div></blockquote></blockquote>
<div dir="ltr">     </div>
<div dir="ltr"> </div>
<blockquote dir="ltr" style="margin-right:0px">
  <blockquote dir="ltr" style="margin-right:0px">
    <div dir="ltr">
    <div>Vector params = new Vector();</div>
    <div>params.add(template);</div>
    <div>RPCUtil util = new RPCUtil(this.imageDAO.getDataCenterIp(null));//get 
    opennebula ip/username/passwd</div>
    <div>Object[] rsObject = util.executeRpcMethod("one.image.allocate", params);</div>
    <div>if (!(Boolean) rsObject[0]){</div>
    <div>    runLog.error((String)rsObject[1]);</div>
    <div>    throw new BaseException("failed to image register!");</div>
    <div>}</div>
    <div> </div>
    <div> </div></div></blockquote></blockquote>
<div dir="ltr" style="text-indent:2em">From <a href="http://opennebula.org" target="_blank">opennebula.org</a> document said:</div>
<blockquote dir="ltr" style="margin-right:0px">
  <div dir="ltr" style="text-indent:2em"><font style="background-color:#6e7406">When a new image template is allocated, the 
  core will insert the image in the system in <code>DISABLED</code> state. The 
  developer has to request the extended information for the new image, and copy 
  (or create) the file to the <code>SOURCE</code> attribute (added by the core). 
  After the file is copied (or created), the image has to be enabled. 
  </font></div></blockquote>
<div dir="ltr"> </div>
<div dir="ltr" style="text-indent:2em">When I used the command "oneimage 
register  xxx.one" ,the new image file has generated!</div>
<div dir="ltr" style="text-indent:2em"> </div>
<div dir="ltr" style="text-indent:2em">Waiting for your reply!</div>
<div dir="ltr" style="text-indent:2em"> </div>
<div dir="ltr" style="text-indent:2em">Thanks and Regars!</div>
<div dir="ltr" style="text-indent:2em">david.</div></font></div></font></div>
<div><font face="Verdana" size="2"></font> </div>
<div align="left"><font color="#c0c0c0" face="Verdana" size="2">2011-03-30 
</font></div><font face="Verdana" size="2">
<hr style="width:122px;min-height:2px" align="left" size="2">

<div><font color="#c0c0c0" face="Verdana" size="2"><span>liudewei</span> 
</font></div></font><font face="monospace">---------------------------------------------------------------------------------------------------<br>
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) <br>
is intended only for the use of the intended recipient and may be confidential and/or privileged of <br>
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is <br>
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying <br>
is strictly prohibited, and may be unlawful.If you have received this communication in error,please <br>
immediately notify the sender by return e-mail, and delete the original message and all copies from <br>
your system. Thank you. <br>
---------------------------------------------------------------------------------------------------</font></div>
<br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br>