[one-users] How about specify multiple network card IP In virtual machine template?

David david1228 at foxmail.com
Wed Apr 17 05:32:21 PDT 2013


hi, all.
I need specify multiple card network IP,genreate context file IP info error, the ETH0_IP and ETH1_IP is the same.
context.sh as follows:
# Context variables generated by OpenNebula
DISK_ID="1"
ETH0_DNS1="8.8.8.8"
ETH0_DNS2="4.4.4.4"
ETH0_GATEWAY="10.10.60.254"
ETH0_IP="10.10.60.200"
ETH0_NETMASK="255.255.255.0"
ETH1_DNS1="8.8.8.8"
ETH1_DNS2="4.4.4.4"
ETH1_GATEWAY="10.10.60.254"
ETH1_IP="10.10.60.200"
ETH1_NETMASK="255.255.255.0"
FILES="/opt/images/script/init.sh 
GANGLIA_CLUSTER_NAME="unspecified""
GANGLIA_HOST_IP="192.168.39.80""
HOSTNAME="BCI0000002b_TEST"
ROOT_PASSWD="test_123456"
TARGET="hdc"
VM_UUID="BCI0000002b_TEST"



but,  depolyment.0 file generated by OpenNebula no problem:
deployment.0 as follows:
.....
<disk type='file' device='cdrom'>
			<source file='/one_images/0/31/disk.1'/>
			<target dev='hdc'/>
			<readonly/>
			<driver name='qemu' type='raw'/>
		</disk>
		<interface type='bridge'>
			<source bridge='onebr1060'/>
			<mac address='02:00:0a:be:3c:c8'/>
			<model type='virtio'/>
		</interface>
		<interface type='bridge'>
			<source bridge='onebr1060'/>
			<mac address='02:00:0a:be:3c:c9'/>
			<model type='virtio'/>
		</interface>

....


The virtual machine template as follows:
explain: ETH0_IP = "$NIC[IP]" and ETH0_IP = "$NIC[IP, NETWORK=\"10.10.60.0\"]", Test results for the same problem. multiple card ip alike of context.sh .
NAME = BCI0000002b_TEST
MEMORY = 512
CPU = 1.0
VCPU = 1
RANK = "FREECPU"
OS = [ BOOT = hd, ARCH = x86_64 ]
DISK = [ IMAGE_ID = 28,TARGET = vda,BUS = virtio,READONLY = no ]
INPUT = [ TYPE = tablet,BUS = usb ]
GRAPHICS = [ TYPE = vnc,LISTEN = 0.0.0.0,PORT = -1 ]
NIC = [ MODEL = virtio,NETWORK = 10.10.60.0,IP = 10.10.60.200 ]
NIC = [ MODEL = virtio,NETWORK = 10.10.60.0,IP = 10.10.60.201 ]
CONTEXT = [ VM_UUID = $NAME,HOSTNAME = $NAME,ETH0_IP = "$NIC[IP]",ETH0_NETMASK = 255.255.255.0,ETH0_GATEWAY = 10.10.60.254,ETH0_DNS1 = 8.8.8.8,ETH0_DNS2 = 4.4.4.4,ETH1_IP = "$NIC[IP]",ETH1_NETMASK = 255.255.255.0,ETH1_GATEWAY = 10.10.60.254,ETH1_DNS1 = 8.8.8.8,ETH1_DNS2 = 4.4.4.4,GANGLIA_HOST_IP = 192.168.39.80",GANGLIA_CLUSTER_NAME = unspecified",ROOT_PASSWD = "test_123456",FILES = "/opt/images/script/init.sh ,TARGET = hdc ]



How to correctly specify the IP?

regards!

Thanks very much!

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20130417/68834f38/attachment.htm>


More information about the Users mailing list