[one-users] VM boots but is not reachable
Jack Jill
jacknjill111 at gmail.com
Thu Feb 11 08:03:41 PST 2010
You can attach a "console" to the VM and access the console via "virsh"
You can setup console access by adding the following to the VM template
defn.
RAW = [ type = "kvm",
data = "<devices><serial type=\"pty\"><source
path=\"/dev/pts/5\"/><target port=\"0\"/></serial><console type=\"pty\"
tty=\"/dev/pts/5\"><source path=\"/dev/pts/5\"/><target
port=\"0\"/></console></devices>" ]
Steps:
--------
1. Define a new VM (say vm2) template with console access like below:
#-----------------------------
----------
# VM definition example
#---------------------------------------
NAME = vm2
CPU = 1
MEMORY = 512
# --- kernel & boot device ---
OS = [
kernel = "/vmlinuz",
initrd = "/initrd.img",
root = "sda" ]
# --- 2 disks ---
DISK = [
source = "/srv/cloud/temp/vm1.img",
target = "sda",
readonly = "no" ]
DISK = [
type = swap,
size = 1024,
target = "sdb",
readonly = "no" ]
# --- 1 NIC ---
NIC = [ NETWORK = "Small network" ]
RAW = [ type = "kvm",
data = "<devices><serial type=\"pty\"><source
path=\"/dev/pts/5\"/><target port=\"0\"/></serial><console type=\"pty\"
tty=\"/dev/pts/5\"><source path=\"/dev/pts/5\"/><target
port=\"0\"/></console></devices>" ]
2. Next create the VM using "onevm -v create <templateName>
3. SSH onto the host
4. Run "virsh list" to confirm the VM is running
5. Run "sudo virsh console <domainName>" to gain access to the VM. Hit
<Enter> key a couple of times to get to the "login"
You can now check the IP address.
--
Thanks,
Rosh
http://blogs.plexibus.com
On Thu, Feb 11, 2010 at 9:18 AM, Harder, Stefan <
Stefan.Harder at fokus.fraunhofer.de> wrote:
> Hi,
>
>
>
> thank you for your quick answer.
>
>
>
> “onevm show vm1” shows me the template with the right IP yes.
>
>
>
> In the prepared VM I installed the vmcontext.sh script in /etc/init.d and
> set a symbolic link to /etc/rcS.d. But it still doesn’t work. I also tried
> /etc/rc2.d. But still the same. Since the node where the VMs run on is a
> server which I only have ssh access to VNC won’t work like Jaime said,
> right? Is there another way to log into a VM with no network configured?
> Does virsh has this possibility?
>
>
>
> I don’t know what to try else… Is there somewhere a tutorial about setting
> up a simple (ubuntu server) VM for using it with OpenNebula? Maybe I already
> make mistakes here. But would OpenNebula boot the VM and set the status as
> “runn” if something wents wrong?
>
>
>
> Sorry for asking so much newbie questions.
>
>
>
> Best regards,
>
>
>
> Stefan
>
>
>
> *Von:* Jack Jill [mailto:jacknjill111 at gmail.com]
> *Gesendet:* Mittwoch, 10. Februar 2010 17:57
> *An:* Harder, Stefan
> *Betreff:* Re: [one-users] VM boots but is not reachable
>
>
>
> Does "onevm show vm1" show you the IP address that you used?
>
> I believe the few ways for VMs to obtain the IP address is:
> - get the IP from the MAC address
> - using contextualization
>
> IP from mac:
> You will need to install the script (see Guest OS config section under
> http://www.opennebula.org/doku.php?id=documentation:howto_vnet) in your VM
> image under /etc/init.d and configure it to be run before networking starts
>
> Using Contextualization:
> See: http://www.opennebula.org/doku.php?id=documentation:rel1.4:cong
>
>
>
> HTH
> --
> Thanks,
> Rosh
> http://blogs.plexibus.com
>
> On Wed, Feb 10, 2010 at 10:21 AM, Harder, Stefan <
> Stefan.Harder at fokus.fraunhofer.de> wrote:
>
> Hi,
>
> I'm pretty new to OpenNebula. I compiled, installed, and configured it
> in Version 1.4 (using KVM) on two Ubuntu 9.10 Servers. My cluster node
> has a network bridge br0 and the ttylinux example works fine.
>
> But now I wanted to deploy a self created VM so I created one with the
> Virtual Machine Manager on my workstation. I used Ubuntu 9.10 server
> 64bit for that, configured the /etc/network/interfaces of the VM with
> the right IP, installed sshd, and copied the image to the server who is
> the cloud manager. onevm create vm1 works, VM status after a while is
> runn.
>
> But unlike the ttylinux my VM is not pingable or reachable via ssh.
>
> Did I miss something to configure? Or any other mistakes?
>
> My templates look like this:
>
> small_network.net:
> ------------------
> NAME = "Small network"
> TYPE = FIXED
>
> #Now we'll use the cluster private network (physical)
> BRIDGE = br0
> LEASES = [ IP="xxx.xxx.xxx.204"]
>
> vm1.one:
> --------
> #---------------------------------------
> # VM definition example
> #---------------------------------------
>
> NAME = vm1
>
> CPU = 1
> MEMORY = 512
>
> # --- kernel & boot device ---
>
> OS = [
> kernel = "/vmlinuz",
> initrd = "/initrd.img",
> root = "sda" ]
>
> # --- 2 disks ---
>
> DISK = [
> source = "/srv/cloud/temp/vm1.img",
> target = "sda",
> readonly = "no" ]
>
> DISK = [
> type = swap,
> size = 1024,
> target = "sdb",
> readonly = "no" ]
>
> # --- 1 NIC ---
>
> NIC = [ NETWORK = "Small network" ]
>
>
> Best regards
>
> Stefan
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20100211/7c5cf878/attachment-0003.htm>
More information about the Users
mailing list