[one-users] How to create an image in opennebula system?

张佳宝 zhangjiabao at gmail.com
Sun Nov 1 23:41:51 PST 2009


Hi,
I have installed opennebula in my hosts,and I want to create a VM using the
following template:
------------------------------------------------------------------------
NAME   = xen01
CPU    = 1
MEMORY = 512
OS = [ kernel     = "/boot/vmlinuz-2.6.18-128.el5xen",
       initrd     = "/boot/initrd-2.6.18-128.el5xen.img",
       root       = "sda1"]
DISK = [ source   = "/home/domains/disk.img",
         target   = "sda1",
         readonly = "no"]
DISK = [  type     = "swap",
          size     = 512,
          target   = "sdb1",
 NIC = [NETWORK="Public VLAN"]
 -----------------------------------------------------------------------
The Network "Public VLAN" is a vitural network I have defined,and I can see
it has been defined succesfuly.
-------------------------------------------------------------------------
[root at oneserver domains]# onevnet list
NID NAME              TYPE BRIDGE
   1 Public VLAN      Fixed   eth0
[root at oneserver domains]# onevnet show 1
NID               : 1
UID               : 0
Network Name      : Public VLAN
Type              : Fixed
Bridge            : eth0

 ....: Template :....
         BRIDGE=eth0
        LEASES=IP=192.168.1.249,MAC=00:1C:25:A2:8D:B7
        NAME=Public VLAN
        TYPE=FIXED
....: Leases :....
IP = 192.168.1.249  MAC = 00:1c:25:a2:8d:b7  USED = 1 VID = 42
-------------------------------------------------------------------------

but now I am not sure how to create an image,in my template the question is
how to define the  'source   = "/home/domains/disk.img" '.

I use the following order to create the virtual-disk disk.img
------------------------------------------------------------------
dd if=/dev/zero of=/home/domains/disk.img bs=1M count=2000
mksf.ext3 /home/domains/disk.img
------------------------------------------------------------------
after that I do not know if I should do something else with the disk.img
and how to do? is anyone knows?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20091102/d4b789f2/attachment-0002.htm>


More information about the Users mailing list