Friday, November 23, 2012

Run VM instance on Eucalyptus, Xen

(on front machine)

1.  check image

 $ euca-describe-images  

note down the image id: emi-xxxxxxx

2. create key pair

$ euca-add-keypair user01-keypair > user01-keypair.private  
$ chmod 0600 user01-keypair.private  
$ euca-describe-keypairs  

 KEYPAIR     user01-keypair 
03:d8:30:69:36:41:62:f8:6b:60:8d:17:19:c1:29:16:5b:6e:79:a9  

3. Authorize security groups

unlimited support on ssh port 22

 euca-authorize -P tcp -p 22 -s 0.0.0.0/0 default  

4. Launch an instance

euca-run-instances emi-48AE3FD9 -k user01-keypair

if instance is launched, the following should be shown:

 RESERVATION     r-B5A143D7     292622667431     default  
 INSTANCE     i-28C442AB     emi-48AE3FD9     0.0.0.0     0.0.0.0     pending     user01-keypair     0          m1.small     2012-11-19T15:28:09.818Z     cluster01     eki-855C3923     eri-05BE397E          monitoring-disabled     0.0.0.00.0.0.0               instance-store            

5. Get instance status & log into the instance

euca-describe-instances
ssh -i user01-keypair.private root@<instance_ip>  

Trouble shooting: 

1) error: RunInstancesType: Not enough resources (0 in cluster01 < 1): vm instances.

run the following on front machine, NC and CC:

 euca-describe-availability-zones verbose  
 ip addr show  
 route -n  

run the following on cluster machine:

 euca-describe-services -E  

2) @ nc.log (*** still searching for solution****)

 [Mon Nov 19 15:36:52 2012][002893][EUCAINFO ] [i-CA574225] tuning root file system on disk 0 partition 1  
 [Mon Nov 19 15:36:52 2012][002893][EUCAERROR ] {2798909184} error: bad return code from cmd '//usr/lib/eucalyptus/euca_rootwrap /sbin/tune2fs /dev/mapper/euca-W9JINGX8VP5TYHDLPJPZM-i-CA574225-emi-48AE3$  
 [Mon Nov 19 15:36:52 2012][002893][EUCADEBUG ] /sbin/tune2fs: Bad magic number in super-block while trying to open /dev/mapper/euca-W9JINGX8VP5TYHDLPJPZM-i-CA574225-emi-48AE3FD9-6d4be1e1  
 Couldn't find valid filesystem superblock.  
 tune2fs 1.42 (29-Nov-2011)  
 [Mon Nov 19 15:36:52 2012][002893][EUCAINFO ] {2798909184} error: cannot tune file system on '/dev/mapper/euca-W9JINGX8VP5TYHDLPJPZM-i-CA574225-emi-48AE3FD9-6d4be1e1'  
 [Mon Nov 19 15:36:52 2012][002893][EUCAERROR ] [i-CA574225] error: failed to tune root file system: blobstore.c:3196 file access only supported for uncloned blockblobs  
 [Mon Nov 19 15:36:52 2012][002893][EUCAERROR ] [i-CA574225] error: failed to create artifact emi-48AE3FD9-6d4be1e1 (error=1, may retry) on try 1  
 [Mon Nov 19 15:36:52 2012][002893][EUCADEBUG ] {2798909184} detaching from loop device /dev/loop5  
 [Mon Nov 19 15:36:52 2012][002893][EUCADEBUG ] {2798909184} detaching from loop device /dev/loop4  
 [Mon Nov 19 15:36:52 2012][002893][EUCADEBUG ] [i-CA574225] error: failed to implement artifact 019|emi-48AE3FD9-6d4be1e1 on try 1  
 [Mon Nov 19 15:36:52 2012][002893][EUCAERROR ] [i-CA574225] error: failed to provision dependency emi-48AE3FD9-6d4be1e1 for artifact dsk-48AE3FD9-09c9bcae (error=1) on try 1  
 [Mon Nov 19 15:36:52 2012][002893][EUCADEBUG ] [i-CA574225] error: failed to implement artifact 024|dsk-48AE3FD9-09c9bcae on try 1  
 [Mon Nov 19 15:36:52 2012][002893][EUCAERROR ] [i-CA574225] error: failed to provision dependency dsk-48AE3FD9-09c9bcae for artifact i-CA574225 (error=1) on try 1  
 [Mon Nov 19 15:36:52 2012][002893][EUCADEBUG ] [i-CA574225] error: failed to implement artifact 013|i-CA574225 on try 1  
 [Mon Nov 19 15:36:52 2012][002893][EUCAERROR ] [i-CA574225] error: failed to implement backing for instance  
 [Mon Nov 19 15:36:53 2012][002893][EUCAERROR ] [i-CA574225] error: failed to prepare images for instance (error=1)  
 [Mon Nov 19 15:36:53 2012][002893][EUCADEBUG ] [i-CA574225] state change for instance: Staging -> Shutoff (Pending)  
 [Mon Nov 19 15:36:53 2012][002893][EUCAINFO ] [i-CA574225] cleaning up state for instance  

3) if nc.log does not log or error in cc.log
 ERROR: DescribeResource() could not be invoked (check NC host, port, and credentials)

-check whether nc node is running, if not run

 sudo service eucalyptus-nc start  

- check whether xend is runing using
 sudo xm list  

if not run

 sudo service xend start  

4)

$ virsh version
Compiled against library: libvir 0.9.8
Using library: libvir 0.9.8
Using API: QEMU 0.9.8
Running hypervisor: QEMU 1.0.0


solution:
$ sudo -s
# echo "export VIRSH_DEFAULT_CONNECT_URI=xen:///" >> /etc/profile.d/libvirtd.sh
# chmod +x /etc/profile.d/libvirtd.sh

# reboot 

modify /etc/xen/xend-config.sxp
(xend-http-server yes)
(xend-unix-server yes)

(xend-unix-path /var/lib/xend/xend-socket)


#sudo service xend restart
#sudo service eucalyptus-nc restart
#virsh version

2012-11-22 14:08:10.678+0000: 3051: info : libvirt version: 0.9.8
2012-11-22 14:08:10.678+0000: 3051: warning : xenHypervisorMakeCapabilities:2751 : Failed to get host power management capabilities
Compiled against library: libvir 0.9.8
Using library: libvir 0.9.8
Using API: Xen 0.9.8
Running hypervisor: Xen 4.1.0

5) running with ip 0.0.0.0

check the instance in the console using

 sudo xm console <instance-id>  

look for network configuration and ip address.

6) RunInstancesType: Failed to lookup kernel image information unknown because of: Attempt to resolve a kerneId for BootableSet:machine=arn:aws:euca:eucalyptus:388002304024:image/emi-3F8B38A3/:ramdisk=false:kernel=false:isLinux=true during request RunInstancesType:2cc2fab3-6e36-45f9-986a-33dcb278399e:return=true:epoch=null:status=null

kernel and rmdisk are not registered. check in download files for correspondent hypervisor, then use 3 commands to bundle, upload, register both of them. run the instance again.

1 comment:

  1. Hi my friend. Do you find the solution of the erro 2 ( error: bad return code from cmd '//usr/lib/eucalyptus ....) ?
    I have the same error.
    Thanks.

    ReplyDelete