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. Bart van Kleef

    Bart van Kleef New Member

    VMware use hda5 instade of hda6 for the VM's

    Firstly, I'll try to make my question as clearly as possible, despite my poor English and thanks for making the great howto's! After strictly follow this and this howto, saves VMware Server (2.0 Release Candidate 1) the VM's on hda5 as I set hda6. And I see nowhere (with fdisk-l or df -h) /dev/drbd0... :confused:

    Here what I've done:
    Befor the installation of VMware, I have created a new directory as in the aforementioned how to was described by:
    Code:
    mkdir /var/vm
    To save the VM's on that location. During the installation of VMware Server I also changed the Datastore default in /var/vm. (So from here it is obvious that the VM's to be saved on hda5.)
    But because DRBD is set at hda6 (see drbd.conf) and I enter
    Code:
    mount-t ext3 /dev/drbd0 /var/vm
    what the location changes from /var/vm on hda5 to /var/vm on hda6, right?

    My partition scheme is as follows:
    /dev/hda1 | 0.01 GB | boot (primary, ext3, bootable flag: on)
    /dev/hda5 | 3.80 GB | / (logical, ext3)
    /dev/hda6 | 25.4 GB | unmounted (logical, ext3, will contain the /var/vm directory)
    /dev/hda7 | 1.00 GB | swap (logical, swap)

    But hda6 should be well formatted with ext3 or just created?

    The output from fdisk -l shows:
    Code:
    Disk /dev/hda: 30.7 GB, 30750031872 bytes
    255 heads, 63 sectors/track, 3738 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1          12       96358+  83  Linux
    /dev/hda2              13        3738    29929095    5  Extended
    /dev/hda5              13         474     3710983+  83  Linux
    /dev/hda6             475        3611    25197921   83  Linux
    /dev/hda7            3612        3738     1020096   82  Linux swap / Solaris
    
    And df -h:
    Code:
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda5             3.5G  3.2G  197M  95% /
    tmpfs                 380M     0  380M   0% /lib/init/rw
    udev                   10M   44K   10M   1% /dev
    tmpfs                 380M     0  380M   0% /dev/shm
    /dev/hda1              92M   12M   75M  14% /boot
    
    My drbd.conf:
    Code:
    resource vm1 {
      protocol C;
      incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";
      startup {
        wfc-timeout 10;             # 10 seconds
        degr-wfc-timeout 30;        # 30 seconds
      }
      disk {
        on-io-error detach;
      }
      net {
        max-buffers 20000;          # Play with this setting to achieve highest possible performance
        unplug-watermark 12000;     # Play with this setting to achieve highest possible performance
        max-epoch-size 20000;       # Should be the same as max-buffers
      }
      syncer {
        rate 10M;           # Use more if you have a Gigabit network, speed is in Kylobytes. e.g.: 10M = 10Megabytes
        group 1;
        al-extents 257;
      }
      on server1.home {                   # Use the exact hostname of your server as give by the command "uname -n"
        device     [B]/dev/drbd0[/B];              # Drbd device ID
        disk       [B]/dev/hda6[/B];               # physical disk device, check your partitioning scheme!
        address    192.168.1.15:7789;       # Fixed IP address of Sproetjuh.home
        meta-disk  internal;                # I use internal metadata storage
      }
      on server2.home {
        device     [B]/dev/drbd0[/B];
        disk       [B]/dev/hda6[/B];
        address    192.168.1.17:7789;
        meta-disk  internal;
      }
    }
    
    I hope you can help me :D because I really do not know where I should start right now.. :(
     
    Last edited: Aug 5, 2008
  2. Bart van Kleef

    Bart van Kleef New Member

    81 views and no answer? Come on I really need your help :(
     
  3. falko

    falko Super Moderator

    I haven't tried the VMware replication howto, but have you tried to contact the author?
     
  4. Bart van Kleef

    Bart van Kleef New Member

    Thank you for your reply Falko, I'll follow your suggestion right now! :)

    Greetings from The Netherlands!
     
  5. thanis

    thanis New Member

    Hi Bart,

    It seems that your DRBD device is not started. Did you start DRBD ? You should not be able to see /dev/hda6. Please let me know at what point of the tutorial you are, as I think you have skipped some steps.

    Grtz from Belgica :)
    Groeten uit Antwerpen.
     
  6. Bart van Kleef

    Bart van Kleef New Member

    Thank you for taking your time thanis, and others who reading this reply right now! I've followed your how to (step for step) again and again with a new installation on both servers. But whatever I do after a reboot of the two servers drbd0 isn't mounted. Not even when I run /etc/init.d/drbd stop/start/restart.
    When I try to mount it again (mount -t ext3 /dev/drbd0 /var/vm) I get the following: mount: block device /dev/drbd0 is write-protected, mounting read-only mount: /dev/drbd0 already mounted or /var/vm busy
    I have no idea what I'm doing wrong, I hope you do!!

    Friendly greetings,

    Bart van Kleef
     
  7. thanis

    thanis New Member

    Bart, your main issue is the not starting of the DRBD volume. What error do you get when running /etc/init.d/drbd start ? Can you post your drbd.conf for both servers ?

    thanks,
    Thanis
     
  8. Bart van Kleef

    Bart van Kleef New Member

    Thanis, thanks again! :) The rare thing is, I get no error when I run "/etc/init.d/drbd start"

    Code:
    sproetjuh:~# /etc/init.d/drbd start
    Starting DRBD resources:    [ ].
    sproetjuh:~# /etc/init.d/drbd stop
    Stopping all DRBD resources.
    sproetjuh:~# /etc/init.d/drbd start
    Starting DRBD resources:    [ d0 s0 n0 ].
    
    Code:
    kimmetjuh:~# /etc/init.d/drbd start
    Starting DRBD resources:    [ ].
    kimmetjuh:~# /etc/init.d/drbd stop
    Stopping all DRBD resources.
    kimmetjuh:~# /etc/init.d/drbd start
    Starting DRBD resources:    [ d0 s0 n0 ].
    
    And here are the configs:

    Code:
    sproetjuh:~# cat /etc/drbd.conf
    resource vm1 {
      protocol C;
      incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";
      startup {
        wfc-timeout  10;            # 10 seconds
        degr-wfc-timeout 30;    # 30 seconds
      }
      disk {
        on-io-error   detach;
      }
      net {
        max-buffers   20000;                # Play with this setting to achieve highest possible performance
        unplug-watermark   12000;           # Play with this setting to achieve highest possible performance
        max-epoch-size 20000;               # Should be the same as max-buffers
      }
      syncer {
        rate 10M;           # Use more if you have a Gigabit network. Speed is in Kylobytes. e.g.: 10M = 10Megabytes
        group 1;
        al-extents 257;
      }
      on sproetjuh {                # Use the EXACT hostname of your server as give by the command "uname -n"
        device     /dev/drbd0;              # drbd device ID
        disk       /dev/hda6;               # physical disk device , check your partitioning scheme !!
        address    192.168.1.13:7789;       # Fixed IP address of server1
        meta-disk  internal;                # I use internal metadata storage
      }
      on kimmetjuh {
        device     /dev/drbd0;
        disk       /dev/hda6;
        address    192.168.1.15:7789;
        meta-disk  internal;
      }
    }
    Code:
    kimmetjuh:~# cat /etc/drbd.conf
    resource vm1 {
      protocol C;
      incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ; halt -f";
      startup {
        wfc-timeout  10;            # 10 seconds
        degr-wfc-timeout 30;    # 30 seconds
      }
      disk {
        on-io-error   detach;
      }
      net {
        max-buffers   20000;                # Play with this setting to achieve highest possible performance
        unplug-watermark   12000;           # Play with this setting to achieve highest possible performance
        max-epoch-size 20000;               # Should be the same as max-buffers
      }
      syncer {
        rate 10M;           # Use more if you have a Gigabit network. Speed is in Kylobytes. e.g.: 10M = 10Megabytes
        group 1;
        al-extents 257;
      }
      on sproetjuh {                # Use the EXACT hostname of your server as give by the command "uname -n"
        device     /dev/drbd0;              # drbd device ID
        disk       /dev/hda6;               # physical disk device , check your partitioning scheme !!
        address    192.168.1.13:7789;       # Fixed IP address of server1
        meta-disk  internal;                # I use internal metadata storage
      }
      on kimmetjuh {
        device     /dev/drbd0;
        disk       /dev/hda6;
        address    192.168.1.15:7789;
        meta-disk  internal;
      }
    }
    Code:
    sproetjuh:~# cat /proc/drbd
    version: 0.7.21 (api:79/proto:74)
    SVN Revision: 2326 build by root@sproetjuh, 2008-08-11 23:40:44
     0: cs:Connected st:Secondary/Secondary ld:Consistent
        ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
    
    Code:
    kimmetjuh:~# cat /proc/drbd
    version: 0.7.21 (api:79/proto:74)
    SVN Revision: 2326 build by root@kimmetjuh, 2008-08-12 16:54:02
     0: cs:Connected st:Secondary/Secondary ld:Consistent
        ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
    Code:
    sproetjuh:~# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda5             4.5G  1.6G  2.7G  38% /
    tmpfs                1015M     0 1015M   0% /lib/init/rw
    udev                   10M   44K   10M   1% /dev
    tmpfs                1015M     0 1015M   0% /dev/shm
    /dev/hda1              92M   12M   75M  14% /boot
    Code:
    kimmetjuh:~# df -h
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hda5             4.5G  1.6G  2.7G  38% /
    tmpfs                1015M     0 1015M   0% /lib/init/rw
    udev                   10M   44K   10M   1% /dev
    tmpfs                1015M     0 1015M   0% /dev/shm
    /dev/hda1              92M   12M   75M  14% /boot
    Code:
    sproetjuh:~# fdisk -l
    Disk /dev/hda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1          12       96358+  83  Linux
    /dev/hda2              13        9729    78051802+   5  Extended
    /dev/hda5              13         596     4690948+  83  Linux
    /dev/hda6             597        9483    71384796   83  Linux
    /dev/hda7            9484        9729     1975963+  82  Linux swap / Solaris
    Code:
    kimmetjuh:~# fdisk -l
    
    Disk /dev/hda: 80.0 GB, 80026361856 bytes
    255 heads, 63 sectors/track, 9729 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *           1          12       96358+  83  Linux
    /dev/hda2              13        9729    78051802+   5  Extended
    /dev/hda5              13         596     4690948+  83  Linux
    /dev/hda6             597        9483    71384796   83  Linux
    /dev/hda7            9484        9729     1975963+  82  Linux swap / Solaris

    Isn't this the problem:

    Code:
    sproetjuh:~# cat /proc/drbd
    version: 0.7.21 (api:79/proto:74)
    SVN Revision: 2326 build by root@sproetjuh, 2008-08-11 23:40:44
     0: cs:Connected st:[B]Secondary[/B]/Secondary ld:Consistent
        ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0
    And again you're my only hope..

    Cordial greetings and thanks for your help,

    Bart van Kleef
     
    Last edited: Aug 12, 2008
  9. thanis

    thanis New Member

    Hi Bart,

    I'm guessing you skipped a part of the howto :)

    Please review this:
    Code:
    Now we define "server1" as the primary/master server:
    
    On "sproetjuh":
    
    drbdsetup /dev/drbd0 primary --do-what-I-say
    mkfs.ext3 /dev/drbd0
    
    Wait a while to have the "ext3" filesystem created on /dev/drbd0 and then:
    
    drbdadm connect all
    
    If you don't get errors, you should be able to continue the howto (e.g. mount the /var/vm etc ...). If you do get errors using any of these commands, please post it here !

    Grtz,
    Thanis
     
  10. Bart van Kleef

    Bart van Kleef New Member

    Thanis,

    No that's not the point where I went wrong. :( If I can believe google secondary/secondary is normal. Heartbeat makes one primary.

    But you're right when I run on sproetjuh:

    Code:
    drbdsetup /dev/drbd0 primary --do-what-I-say
    mkfs.ext3 /dev/drbd0
    
    mount -t ext3 /dev/drbd0 /var/vm
    
    Is drbd0 showed in the output of df -h! :)

    But after a reboot the status of drbd is again secondary/secondary and drbd0 is gone in df -h..

    So I guess its hearbeat, here are my configs:

    Code:
    sproetjuh:~# cat /etc/ha.d/ha.cf
    logfile /var/log/ha-log
    logfacility     local0
    keepalive 1
    deadtime 10
    warntime 10
    udpport 694
    bcast   eth1
    auto_failback off
    node    sproetjuh  ## make sure both names are accessible - check /etc/hosts
    node    kimmetjuh
    ping [COLOR="Lime"]10.1.1.15[/COLOR]  ## Enter an IP address that is pingable from the ETH0 network !!
    respawn hacluster /usr/lib/heartbeat/ipfail
    
    Code:
    kimmetjuh:~# cat /etc/ha.d/ha.cf
    logfile /var/log/ha-log
    logfacility     local0
    keepalive 1
    deadtime 10
    warntime 10
    udpport 694
    bcast   eth1
    auto_failback off
    node    sproetjuh  ## make sure both names are accessible - check /etc/hosts
    node    kimmetjuh
    ping [COLOR="Lime"]10.1.1.13[/COLOR]  ## Enter an IP address that is pingable from the ETH0 network !!
    respawn hacluster /usr/lib/heartbeat/ipfail
    
    Code:
    sproetjuh:~# cat /etc/ha.d/authkeys
    auth 3
    3 md5 failover  ## this is just a string, enter what you want ! auth 3 md5 uses md5 encryption
    Code:
    kimmetjuh:~# cat /etc/ha.d/authkeys
    auth 3
    3 md5 failover  ## this is just a string, enter what you want ! auth 3 md5 uses md5 encryption
    
    Code:
    sproetjuh:~# cat /etc/ha.d/haresources
    sproetjuh 192.168.1.13 drbddisk::vm1 Filesystem::/dev/drbd0::/var/vm::ext3 vmstart
    
    Code:
    kimmetjuh:~# cat /etc/ha.d/haresources
    sproetjuh 192.168.1.13 drbddisk::vm1 Filesystem::/dev/drbd0::/var/vm::ext3 vmstart
    
    And "ifconfig |more" don't give me any "eth0:0" but:

    Code:
    sproetjuh:~# ifconfig |more
    eth0      Link encap:Ethernet  HWaddr 00:04:75:A9:E6:01
              inet addr:192.168.1.13  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::204:75ff:fea9:e601/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:700 errors:0 dropped:0 overruns:0 frame:0
              TX packets:686 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:56704 (55.3 KiB)  TX bytes:66691 (65.1 KiB)
              Interrupt:185 Base address:0xaf80
    
    eth1      Link encap:Ethernet  HWaddr 00:04:75:A9:E6:B3
              inet addr:10.1.1.13  Bcast:10.1.1.255  Mask:255.255.255.0
              inet6 addr: fe80::204:75ff:fea9:e6b3/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:6945 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6945 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:1072187 (1.0 MiB)  TX bytes:1072200 (1.0 MiB)
              Interrupt:177 Base address:0x4f00
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:29 errors:0 dropped:0 overruns:0 frame:0
              TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:3326 (3.2 KiB)  TX bytes:3326 (3.2 KiB)
    
    vmnet1    Link encap:Ethernet  HWaddr 00:50:56:C0:00:01
              inet addr:192.168.4.1  Bcast:192.168.4.255  Mask:255.255.255.0
              inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
    
    vmnet8    Link encap:Ethernet  HWaddr 00:50:56:C0:00:08
              inet addr:192.168.3.1  Bcast:192.168.3.255  Mask:255.255.255.0
              inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
    
    Code:
    kimmetjuh:~# ifconfig |more
    eth0      Link encap:Ethernet  HWaddr 00:04:75:A9:E7:AE
              inet addr:192.168.1.15  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::204:75ff:fea9:e7ae/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:684 errors:0 dropped:0 overruns:0 frame:0
              TX packets:830 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:57395 (56.0 KiB)  TX bytes:77289 (75.4 KiB)
              Interrupt:185 Base address:0x6f80
    
    eth1      Link encap:Ethernet  HWaddr 00:04:75:8C:4E:3C
              inet addr:10.1.1.15  Bcast:10.1.1.255  Mask:255.255.255.0
              inet6 addr: fe80::204:75ff:fe8c:4e3c/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:7312 errors:0 dropped:0 overruns:0 frame:0
              TX packets:7317 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:1129181 (1.0 MiB)  TX bytes:1129476 (1.0 MiB)
              Interrupt:177 Base address:0x8f00
    
    lo        Link encap:Local Loopback
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:29 errors:0 dropped:0 overruns:0 frame:0
              TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:3326 (3.2 KiB)  TX bytes:3326 (3.2 KiB)
    
    vmnet1    Link encap:Ethernet  HWaddr 00:50:56:C0:00:01
              inet addr:192.168.4.1  Bcast:192.168.4.255  Mask:255.255.255.0
              inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
    
    vmnet8    Link encap:Ethernet  HWaddr 00:50:56:C0:00:08
              inet addr:192.168.3.1  Bcast:192.168.3.255  Mask:255.255.255.0
              inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
    Thanks a lot for all your time! You're my hero ;)
     
    Last edited: Aug 12, 2008
  11. thanis

    thanis New Member

    Ah, now I see. You used IP address 192.168.1.13 in your haresources, while it is already configured on sproetjhuh. You should use a different free IP address as your virtual IP address for the failover. So you need at least 3 address, 1 for sproetjuh, 1 for kimmetjuh and 1 as the virtual IP. The virtual IP is what you use to connect to the active node.

    Grtz,
    Thanis
     
  12. Bart van Kleef

    Bart van Kleef New Member

    Ahh, thanks a lot! I changed it in 192.168.1.10 on both nodes. This IP should also be added /etc/hosts because I get still after a reboot secondary/secondary? If yes, something like:
    Code:
    127.0.0.1       localhost.localdomain   localhost
    192.168.1.10    virtual.home            sproetjuh
    192.168.1.13    sproetjuh.home          sproetjuh
    192.168.1.15    kimmetjuh.home          kimmetjuh
    
    Grtz,

    Bart van Kleef
     
  13. thanis

    thanis New Member

    No it should not be added to your hosts file, (definitely NOT), but please do the following commands again and post the output here:
    1. On kimmetjuh: /etc/init.d/heartbeat stop
    2. On sproetjuh: /etc/init.d/heartbeat restart
    3. On sproetjuh: tail /var/log/ha-log

    I also suggest remove the "vmstart" in your haresources file for testing purposes, as that will probably not work anyway and might actually be the problem :)

    Thanks Thanis
     
    Last edited: Aug 12, 2008
  14. Bart van Kleef

    Bart van Kleef New Member

    So here is the output of "tail /var/log/ha-log":

    Code:
    heartbeat: 2008/08/12_21:07:37 info: pid 4701 locked in memory.
    heartbeat: 2008/08/12_21:07:37 info: Local status now set to: 'up'
    heartbeat: 2008/08/12_21:07:38 info: pid 4703 locked in memory.
    heartbeat: 2008/08/12_21:07:38 info: pid 4704 locked in memory.
    heartbeat: 2008/08/12_21:07:38 info: pid 4705 locked in memory.
    heartbeat: 2008/08/12_21:07:38 info: Link sproetjuh:eth1 up.
    heartbeat: 2008/08/12_21:07:38 info: pid 4706 locked in memory.
    heartbeat: 2008/08/12_21:07:38 info: pid 4707 locked in memory.
    heartbeat: 2008/08/12_21:07:38 info: Link 10.1.1.15:10.1.1.15 up.
    heartbeat: 2008/08/12_21:07:38 info: Status update for node 10.1.1.15: status ping
    
    Thanks,

    Bart van Kleef

    PS Still I got no eth0:0..
     
    Last edited: Aug 12, 2008
  15. thanis

    thanis New Member

    Woops, seems I missed something while reading your configs. Your ha.cf is not correct:
    Your config:
    Code:
    kimmetjuh:~# cat /etc/ha.d/ha.cf
    logfile /var/log/ha-log
    logfacility     local0
    keepalive 1
    deadtime 10
    warntime 10
    udpport 694
    bcast   eth1
    auto_failback off
    node    sproetjuh  ## make sure both names are accessible - check /etc/hosts
    node    kimmetjuh
    ping 10.1.1.13  ## Enter an IP address that is pingable from the ETH0 network !!
    respawn hacluster /usr/lib/heartbeat/ipfail
    At the ping 10.1.1.13 statement I specifically say that this should be pingable from the ETH0 network, however ... eth0 on both nodes is in the 192.168.1.0 network, so the ping "10.1.1.13" should read 192.168.1.1 (or something else, preferably your internet gateway?). If this is set to a non-pingable host, as it is now, heartbeat thinks the network is down ==> ergo, no services are started because both nodes are down!

    Grtz,
    Thanis
     
  16. Bart van Kleef

    Bart van Kleef New Member

    This is so stupid! It explains everything.. I let you know if this works!

    Thank you so much! :D
     
  17. sebastienp

    sebastienp New Member

    Hi Bart,

    Just a question now that everything looks up and running by your side :

    - Does the failover works for you ?

    That means, do you get yours VMs running and accessible on the second node when disconnecting the primary node ?

    I don't understand why it's not working for me...
    So any help/clue/info is appreciated !

    Thank you for your feedback,
    Regards,
    S.
     
  18. Bart van Kleef

    Bart van Kleef New Member

    Sorry for my late reply but I got some other things to do..

    Thanis, thanks you so much! Everything works great now! :D :D

    Sebastien, yes for so far I know. I've seen you're other replies too.
    My heartbeat version is 1.2.5 (http://packages.debian.org/etch/heartbeat), DRBD v0.7.21 (http://packages.debian.org/etch/drbd0.7-module-source, http://packages.debian.org/etch/drbd0.7-utils). And VMware server:
    VMware Infrastructure Web AccessVersion 2.0.0 Build 101583, VMware Server Version 2.0.0 Build 101586 (http://download3.vmware.com/software/vmserver/VMware-server-2.0.0-101586.i386.tar.gz)
    And everything is installed on Debian Etch netinstall (http://cdimage.debian.org/debian-cd/4.0_r4a/i386/iso-cd/debian-40r4a-i386-netinst.iso)

    If you got some more questions let me know!

    Greets,

    Bart van Kleef
     
  19. Bart van Kleef

    Bart van Kleef New Member

    Sorry for my late response!
    Thanis the most of you're howto works fine, once again thank you so much!

    Sebastien, for so far as I know, only one big problem. When I add vmstart to /etc/ha.d/haresources both nodes are in the secondary state:
    Code:
    version: 0.7.21 (api:79/proto:74)
    SVN Revision: 2326 build by root@sproetjuh, 2008-08-13 11:34:17
     0: cs:Connected st:Secondary/Secondary ld:Consistent
        ns:8 nr:0 dw:8 dr:33 al:0 bm:257 lo:0 pe:0 ua:0 ap:0
    
    When I remove the vmstart line in /etc/ha.d/haresources and reboot the two nodes and login into VMware Infrastructure Web Access all of the virtual machines are "unknown (inaccessible)" and the size of /var/vm is only 4.4GB (hda5). When I create a new virtual machine it shows the correct size of drbd0 (hda6) :). Then I remove the unknown machines from the inventory and I add them again to the inventory and everything works fine :). All this happening because I think VMware Server 2 starts earlier than DRBD? And if that's true vmstart could not find the machines at /var/vm because it looks on hda5? And that's the reason the both nodes go into secondary/secondary mode? Or my /etc/ha.d/resource.d/vmstart isn't correct:
    Code:
    #!/bin/bash
    case "$1" in
    start)
    /usr/bin/vmware-cmd -s register "/var/vm/alfresco/alfresco.vmx" 2>/dev/null
    /usr/bin/vmware-cmd "/var/vm/alfresco/alfresco.vmx" start 2>/dev/null
    ;;
    stop)
    /usr/bin/vmware-cmd "/var/vm/alfresco/alfresco.vmx" stop trysoft 2> /dev/null
    ;;
    status)
    if `/usr/bin/vmware-cmd "/var/vm/alfresco/alfresco.vmx" getstate 2>/dev/null | grep -q "getstate() = on"`
    then
    echo "running"
    else
    echo "stopped"
    fi
    ;;
    *)
    echo "Usage: `basename $0` '[COLOR="SeaGreen"]virtual machine file[/COLOR]' {start|stop|status}"
    echo "Where "[COLOR="SeaGreen"]virtual machine file[/COLOR]" is like /var/vm/alfresco/alfresco.vmx"
    ;;
    esac
    exit 0
    For as far as I know, this is just what does not work for me.

    Here some information where you asked for in another thread:
    Heartbeat v1.2.5
    DRBD utils v0.7.2.1
    DRBD module source v0.7.2.1
    VMware Server v2.0.0 Build 101586 and VMware Infrastructure Web Access v2.0.0 Build 101583

    If you have some other questions just let me know!

    Greets,

    Bart van Kleef
     
    Last edited: Aug 18, 2008
  20. Bart van Kleef

    Bart van Kleef New Member

    When I go to /usr/bin and run ls vmware-cmd doesn't exist :confused::
    Code:
    vmnet-bridge
    vmnet-dhcpd
    vmnet-natd
    vmnet-netifup
    vmnet-sniffer
    [COLOR="SeaGreen"]vmrun[/COLOR]
    vmstat
    vm-support
    vmware
    vmware-config.pl
    vmware-mount
    vmware-ping
    vmware-uninstall.pl
    vmware-uninstall-vix.pl
    vmware-vdiskmanager
    vmware-vim-cmd
    vmware-vimsh
    vmware-watchdog
    Code:
    vmrun version 2.0.0 build-101586
    
    Usage: vmrun [AUTHENTICATION-FLAGS] COMMAND [PARAMETERS]
    
    
    
    AUTHENTICATION-FLAGS
    --------------------
    These must appear before the command and any command parameters.
    
       -h <hostName>  (not needed for Workstation)
       -P <hostPort>  (not needed for Workstation)
       -T <hostType> (ws|server|server1)
         for example, use '-T server' for Server 2.0
                      use '-T server1' for Server 1.0
       -u <userName in host OS>  (not needed for Workstation)
       -p <password in host OS>  (not needed for Workstation)
       -gu <userName in guest OS>
       -gp <password in guest OS>
    
    
    
    POWER COMMANDS           PARAMETERS           DESCRIPTION
    --------------           ----------           -----------
    start                    Path to vmx file     Start a VM
                             [gui|nogui]
    
    stop                     Path to vmx file     Stop a VM
                             [hard|soft]
    
    reset                    Path to vmx file     Reset a VM
                             [hard|soft]
    
    suspend                  Path to vmx file     Suspend a VM
                             [hard|soft]
    
    pause                    Path to vmx file     Pause a VM
    
    unpause                  Path to vmx file     Unpause a VM
    
    
    
    SNAPSHOT COMMANDS        PARAMETERS           DESCRIPTION
    -----------------        ----------           -----------
    snapshot                 Path to vmx file     Create a snapshot of a VM
                             Snapshot name
    
    deleteSnapshot           Path to vmx file     Remove a snapshot from a VM
                             Snapshot name
    
    revertToSnapshot         Path to vmx file     Set VM state to a snapshot
                             Snapshot name
    
    
    
    RECORD/REPLAY COMMANDS   PARAMETERS           DESCRIPTION
    ----------------------   ----------           -----------
    beginRecording           Path to vmx file     Begin recording a VM
                             Snapshot name
    
    endRecording             Path to vmx file     End recording a VM
    
    beginReplay              Path to vmx file     Begin replaying a VM
                             Snapshot name
    
    endReplay                Path to vmx file     End replaying a VM
    
    
    
    GUEST OS COMMANDS        PARAMETERS           DESCRIPTION
    -----------------        ----------           -----------
    runProgramInGuest        Path to vmx file     Run a program in Guest OS
                             Program
                             [-noWait]
                             [-activeWindow]
                             [-interactive]
                             [Program arguments]
    
    fileExistsInGuest        Path to vmx file     Check if a file exists in Guest OS
                             Path to file in guest
    
    setSharedFolderState     Path to vmx file     Modify a Host-Guest shared folder
                             Share name
                             Host path
                             writable | readonly
    
    addSharedFolder          Path to vmx file     Add a Host-Guest shared folder
                             Share name
                             New host path
    
    removeSharedFolder       Path to vmx file     Remove a Host-Guest shared folder
                             Share name
    
    listProcessesInGuest     Path to vmx file     List running processes in Guest OS
    
    killProcessInGuest       Path to vmx file     Kill a process in Guest OS
                             process id
    
    runScriptInGuest         Path to vmx file     Run a script in Guest OS
                             Interpreter path
                             script_text
    
    deleteFileInGuest        Path to vmx file     Delete a file in Guest OS
                             Path in guest
    
    createDirectoryInGuest   Path to vmx file     Create a directory in Guest OS
                             Directory path in guest
    
    deleteDirectoryInGuest   Path to vmx file     Delete a directory in Guest OS
                             Directory path in guest
    
    listDirectoryInGuest     Path to vmx file     List a directory in Guest OS
                             Directory path in guest
    
    copyFileFromHostToGuest  Path to vmx file     Copy a file from host OS to guest                                                                                                                                OS
                             Path on host
                             Path in guest
    
    copyFileFromGuestToHost  Path to vmx file     Copy a file from guest OS to host                                                                                                                                OS
                             Path in guest
                             Path on host
    
    renameFileInGuest        Path to vmx file     Rename a file in Guest OS
                             Original name
                             New name
    
    captureScreen            Path to vmx file     Capture the screen of the VM to a                                                                                                                                local file
                             Path on host
    
    writeVariable            Path to vmx file     Write a variable in the VM state
                             [runtimeConfig|guestEnv]
                             variable name
                             variable value
    
    readVariable             Path to vmx file     Read a variable in the VM state
                             [runtimeConfig|guestEnv]
                             variable name
    
    
    
    VPROBE COMMANDS          PARAMETERS           DESCRIPTION
    ---------------          ----------           -----------
    vprobeVersion            Path to vmx file     List VP version
    
    vprobeLoad               Path to vmx file     Load VP script
                             'VP script text'
    
    vprobeReset              Path to vmx file     Disable all vprobes
    
    vprobeListProbes         Path to vmx file     List probes
    
    vprobeListGlobals        Path to vmx file     List global variables
    
    
    
    GENERAL COMMANDS         PARAMETERS           DESCRIPTION
    ----------------         ----------           -----------
    list                                          List all running VMs
    
    upgradevm                Path to vmx file     Upgrade VM file format, virtual hw
    
    installtools             Path to vmx file     Install Tools in Guest
    
    clone                    Path to vmx file     Create a copy of the VM
                             Path to destination vmx file
                             full|linked
                             [Snapshot name]
    
    
    
    
    Examples:
    
    
    Starting a virtual machine with Workstation on a Windows host
       vmrun -T ws start "c:\my VMs\myVM.vmx"
    
    
    Stopping a virtual machine with Server on a linux host
       vmrun -T server -h https://myHost.com/sdk -u hostUser -p hostPassword stop "[                                                                                                                               storage1] vm/myVM.vmx"
    
    
    Running a program in a virtual machine with Workstation on a Windows host with W                                                                                                                               indows guest
       vmrun -T ws -gu guestUser -gp guestPassword runProgramInGuest "c:\my VMs\myVM                                                                                                                               .vmx" "c:\Program Files\myProgram.exe"
    
    
    Running a program in a virtual machine with Server on a linux host with linux gu                                                                                                                               est
       vmrun -T server -h https://myHost.com/sdk -u hostUser -p hostPassword -gu gue                                                                                                                               stUser -gp guestPassword runProgramInGuest "[storage1] vm/myVM.vmx" /usr/bin/X11                                                                                                                               /xclock -display :0
    
    
    Creating a snapshot of a virtual machine with Workstation on a Windows host
       vmrun -T ws snapshot "c:\my VMs\myVM.vmx" mySnapshot
    
    
    Reverting to a snapshot with Workstation on a Windows host
       vmrun -T ws revertToSnapshot "c:\my VMs\myVM.vmx" mySnapshot
    
    
    Deleting a snapshot with Workstation on a Windows host
       vmrun -T ws deleteSnapshot "c:\my VMs\myVM.vmx" mySnapshot
    So it's not surprising that vmstart does't work.

    Regards,

    Bart van Kleef

    PS if you need ssh access let me know.
     
    Last edited: Aug 18, 2008

Share This Page