Failover with VMWare Server - /var/vm isn't the right size..

Discussion in 'HOWTO-Related Questions' started by Bart van Kleef, Aug 5, 2008.

  1. thanis

    thanis New Member

    Actually, this is quite easy. VMWare Server 2.0 uses a different way of starting VM's. So, if you edit the vmstart file and change the lines using "vmware-cmd start/stop..." to
    Code:
    #!/bin/bash 
    case "$1" in 
    start) 
    /usr/bin/vmrun -T server -h https://<server-ip-address>:<port>/sdk -u root -p <rootpassword> start nogui "<path-to-vmxfile>" 2>/dev/null 
    # EXAMPLE:  /usr/bin/vmrun -T server -h https://192.168.1.13/sdk -u root -p password start nogui "/var/vm/myvirtualmachine/myvm.vmx"
    ;;
    stop) 
    /usr/bin/vmrun -T server -h https://<server-ip-address>:<port>/sdk -u root -p <rootpassword> stop "<path-to-vmxfile>" 2>/dev/null 
    ;;
    status) 
    /usr/bin/vmrun -T server -h https://<server-ip-address>:<port>/sdk -u root -p <rootpassword> list
    ;;
    *) 
    echo "Usage: `basename $0` 'virtual machine file' {start|stop|status}" 
    echo "This commands stops/starts/displays all configured VM's. Update this script !!
    ;;
    esac 
    exit 0
    
    Beware, I do not run VMWare Server 2.0 so I do not guarantee the validity of this script. Please check the VMWare Server manual, or revert to version 1.0x for compatability reasons.

    Grtz,
    Thanis
     
  2. Bart van Kleef

    Bart van Kleef New Member

    Thanis, thanks a lot, I would try that! And let you know if it works!

    Thanks,

    Bart van Kleef
     
  3. thanis

    thanis New Member

    I'm guessing it works now ? I am very interested to know, can I get some feedback ?
     
  4. Bart van Kleef

    Bart van Kleef New Member

    Thanis,

    I'm very buzzy with my (other) work right now and got some other things which need to be figure out first. When every runs fine I let you know, and the way I did it!

    Thanks,

    Bart van Kleef
     
  5. Bart van Kleef

    Bart van Kleef New Member

    Thanis,

    I decided to change back to vmware server 1 (1.0.7) because 2 sucks. The reason why I go back:
    When I reboot the primary node all the VM's are inaccessible when I poweroff the primary /var/vm is correctly mounted on the secondary but the VM's are again inaccessible the work around I discovered, delete the inaccessible VM's and make a new VM. Delete that one after you finished the wizard. Now you can add the inaccessible VM's..
    And because of above the whole fail over doens't work :mad:

    So there is one other thing, I got three three on both servers. I want to use eth0 for all the default network traffic, eth1 for heartbeat and eth2 for drbd traffic. So I need to edit /etc/hosts to something like this:
    Code:
    127.0.0.1       localhost.localdomain   localhost
    192.168.1.13    sproetjuh.home          sproetjuhdefault
    192.168.1.14    sproetjuh.home          sproetjuhheartbeat
    192.168.1.15    sproetjuh.home          sproetjuhdrbd
    192.168.1.16    kimmetjuh.home          kimmetjuhdefault
    192.168.1.17    kimmetjuh.home          kimmetjuhheartbeat
    192.168.1.18    kimmetjuh.home          kimmetjuhdrbd
    
    And the /etc/drbd.conf to:
    Code:
    on sproetjuhdrbd {
        device     /dev/drbd0;
        disk       /dev/hda6;
        address    192.168.1.15:7789;
        meta-disk  internal;
      }
      on kimmetjuhdrbd {
        device     /dev/drbd0;
        disk       /dev/hda6;
        address    192.168.1.18:7789;
        meta-disk  internal;
      }
    
    But after this I got the following error:

    Code:
    sproetjuh:~# drbdadm up all
    /etc/drbd.conf:27: in resource vm1, on sproetjuhdrbd { ... } ... on kimmetjuhdrbd { ... }:
            There are multiple host sections for the peer.
            Maybe misspelled local host name 'sproetjuh'?
    And that's logical because:
    Code:
    sproetjuh:~# hostname
    sproetjuh
    sproetjuh:~# hostname -f
    sproetjuh.home
    
    So I hope someone can help me! Because the man page about hosts and google can't help me futher..

    Have a good day,

    Greetings from the Netherlands,

    Bart van Kleef
     

Share This Page