How to create a KVM resource into HAE using ssh transport

  • 7008168
  • 25-May-2012
  • 10-Oct-2014

Environment


SUSE Linux Enterprise High Availability Extension 11 Service Pack 3

Situation

Customers that is running KVM and want to manage VM's using HAE interface to execute functions like stop, start and live migration can use this TID to create a HAE resource for that. This document will not cover KVM installation and we are assuming that you already configured that. You should be able to do one live migration using virsh command line or virtual manager console to complete this task.

Resolution

Before start, make sure that your nodes can access each other using ssh keys. To setup ssh keys you can use these command bellow:

 As root user type that:  # ssh-keygen -t rsa

 which will create the following two keys in the /root/.ssh/ directory:

   id_rsa
   id_rsa.pub

The public key has to be copied over to another node:

  # ssh-copy-id -i ~/.ssh/id_rsa.pub root@nodeX
   
 After this, it is possible for root to ssh without password from one server to the other. This should be done for each and every member server of the cluster.  

1 - Open your hb_gui and click in Connection. Enter your password for hacluster user and login.

2 - On the left side select Resources

3 - On Primitive tab select Add at bottom. Leave as primitive selected and hit OK

4 - At Add Primitive - Basic Settings enter one ID. It can be your Virtual Machine name or wherever name you want to use to identify your resource.

5 - To the other settings enter that information:
        Class = ocf
        Provider = heartbeat
        Type = VirtualDomain
       
     Click in Forward

6- It will open a tab called Instance Attributes. On that tab you will add these parameters
         config = /shared/kvm-config-files/sles11-sp1.xml
         migration_transport = ssh
         autoset_utilization_cpu = false
         autoset_utilization_hv_memory = false
         Select OK

    Note: This sles11-sp1-xml is just one example. You need to copy your Virtual Machine xml file located in /etc/libvirt/qemu to another directory on the shared storage. You can create a directory called kvm-config-files and place all your xml files there.

   Warning: Do NOT point the config parameter to use /etc/libvirt/qemu.  You must need to copy your xml files to another location otherwise, the xml files will be deleted when you start the guest for the first time.
        

7 - Click on Meta Attributes tab and add these configurations:
       target-role = Started
       allow-migrate = true
       is-managed = true      

8 - Click OK until the end and you will be able to see your Resource created.

        
Now you will be able to start, stop and migrate your Virtual Machine using HAE interface.

Additional Information

You can also, use remote TLS/SSL Connection with x509 Certificate (qemu+tls) instead of using ssh. More information you can find here:

https://www.suse.com/documentation/sles11/book_kvm/data/sec_libvirt_connect_remote.html

Feedback service temporarily unavailable. For content questions or problems, please contact Support.