Hyper Open Edge Cloud

How to install KVM instances with SlapOS

A step by step guide to allocate KVM instances with SlapOS either through VIFIB Web user interface or through slapconsole command line interface.
  • Last Update:2013-02-05
  • Version:001
  • Language:en

Using kvm with SlapOS

Agenda

  • Request from web UI, connect
  • Request from console, connect
  • Request on own computer from web UI, connect
  • Request on own computer from console, connect

Web Request (1)

If you don't have a slapos.org account yet, Register to http://www.slapos.org. Then go to "My Services".

Web Request (2)

Click on "New service".

Web Request (3)

Choose a name for your instance, and select "KVM" service type.

Web Request (4)

Choose the latest version of the software.

Web Request (5)

Fill in your personal informations.

Web Request (6)

Instance has been requested, you are redirected to home. Wait for a few seconds, then go back to "My Services".

Web Request (7)

You can see your instance : click on it.

Web Request (8)

You can see your instance being deployed. Reload to have up-to-date informations.

Web Request (9)

Your instance is ready. All the needed informations can be found in the "Connection" xml.

Connect with VNC

Open the url with your browser (recent Chrome/Chromium is preferred). Make sure the ipv6 part is correctly filled in the form ("[" characters can be altered), paste the password, then connect.

Request from console

    # In your slapos client directory :
    $ bin/slapconsole slapos.cfg
    >>> kvm_instance = request(kvm, "second_kvm", 
    partition_parameter_kw={"nbd_ip":"2a01:e35:2e27:460:e2cb:4eff:fed9:48dc", 
    "nbd_port":"1024"})
    Traceback (most recent call last):
    File "", line 1, in 
    File "/Library/Python/2.6/site-packages/.../slapos/console.py", line 108, in 
    slap.registerOpenOrder().request(software_release, reference)
    File "/Library/Python/2.6/site-packages/slapos/slap/slap.py", line 162, in request
    self._connection_helper.POST('/requestComputerPartition', request_dict)
    File "/Library/Python/2.6/site-packages/slapos/slap/slap.py", line 469, in POST
    raise ResourceNotReady("%s - %s" % (path, parameter_dict))
    ResourceNotReady: /requestComputerPartition
    # Wait for a few minutes and retry until it works : 
    >>> kvm_instance = request(kvm, "second_kvm", 
    partition_parameter_kw={"nbd_ip":"2a01:e35:2e27:460:e2cb:4eff:fed9:48dc", 
    "nbd_port":"1024"})
    >>> kvm_instance.getState()
    Started
    >>> kvm_instance.getConnectionParameter('url')
    [URL appears here]
    >>> kvm_instance.getConnectionParameter('password')
    [Password appears here]
  
Slapconsole allows your to interact with the SlapOS Master using the SLAP API. Launch slapconsole, then ask the Master to deploy an instance of your software. First, it will raise an exception meaning that the instance is not ready yet. You will have to wait until the instance is ready. From time to time, run again the same command to fetch up-to-date informations. When it does not longer throw an exception, your instance is ready. You can then fetch the informations you need to connect to your instance

Connect with VNC

Open the url with your browser (recent Chrome/Chromium is preferred). Make sure the ipv6 part is correctly filled in the form ("[" characters can be altered), paste the password, then connect.

Request from console

# In your slapos client directory :
    $ bin/slapconsole slapos.cfg
    >>> kvm_instance = request(kvm, "first_kvm", 
    partition_parameter_kw={"nbd_ip":"2a01:e35:2e27:460:e2cb:4eff:fed9:48dc", "nbd_port":"1024"})
    >>> kvm_instance.getState()
    Started
    >>> kvm_instance.getConnectionParameter('url')
    [URL appears here]
    >>> kvm_instance.getConnectionParameter('password')
    [Password appears here]
  
XXX Slapconsole allows your to interact with the SlapOS Master using the SLAP API. Launch slapconsole, then ask the Master to deploy an instance of your software. First, it will raise an exception meaning that the instance is not ready yet. You will have to wait until the instance is ready. From time to time, run again the same command to fetch up-to-date informations. When it does not longer throw an exception, your instance is ready. You can then fetch the informations you need to connect to your instance

Connect with VNC

Open the url with your browser (recent Chrome/Chromium is preferred). Make sure the ipv6 part is correctly filled in the form ("[" characters can be altered), paste the password, then connect.

Request with SLA (Req.)

Before trying to request an instance on a specific computer, make sure the software you want to use is deployed on this machine. If not sure, go to :

Install and Configure SlapOS Node

How to allow use of VM in a SlapOS Node

Install KVM Software Release

Request with SLA (1)

Register to slapos.org, then go to "My Services".

To request a KVM instance using slapos.org web interface, go to slapos.org, go to My Services, click on the "New service". Put the desired name of the service in "Service title", then select "KVM" in the list of softwares. Make sure you have only one selected software. Send the form by clicking on "Order". On the next page, select the latest version of KVM available, and click on "order". Review and fill your informations, and click on the "Continue" button. You will be redirected to the home page. You will then have to wait for a few minutes for the instance to be deployed. You can know the state of the instantiation by going to "My Services" page. Your instance will appear after a few seconds, if you click on it, you can see the state of it.

Request with SLA (2)

Click on "New service".

Request with SLA (3)

Choose a name for your instance, and select "KVM" service type. Make sure to select the computer where you want the instance to be deployed.

Request with SLA (4)

Choose the latest version of the software.

Request with SLA (5)

Fill in your personal informations.

Request with SLA (6)

Instance has been requested, you are redirected to home. Wait for a few seconds, then go back to "My Services".

Request with SLA (7)

You can see your instance : click on it.

Request with SLA (8)

You can see your instance being deployed. Reload to have up-to-date informations.

Request with SLA (9)

Your instance is ready. All the needed informations can be found in the "Connection" xml.

Connect with VNC

Open the url with your browser (recent Chrome/Chromium is preferred). Make sure the ipv6 part is correctly filled in the form ("[" characters can be altered), paste the password, then connect.

SLA from console

    # In your slapos client directory :
    $ bin/slapconsole slapos.cfg
    >>> kvm_instance = request(kvm, "fourth_kvm",
    partition_parameter_kw={"nbd_ip":"2a01:e35:2e27:460:e2cb:4eff:fed9:48dc", 
    "nbd_port":"1024"},
    filter_kw={ "computer_guid": "COMP-12345" })
    Traceback (most recent call last):
    File "", line 1, in 
    File "/Library/Python/2.6/site-packages/.../slapos/console.py", line 108, in 
    slap.registerOpenOrder().request(software_release, reference)
    File "/Library/Python/2.6/site-packages/slapos/slap/slap.py", line 162, in request
    self._connection_helper.POST('/requestComputerPartition', request_dict)
    File "/Library/Python/2.6/site-packages/slapos/slap/slap.py", line 469, in POST
    raise ResourceNotReady("%s - %s" % (path, parameter_dict))
    ResourceNotReady: /requestComputerPartition
    # Wait for a few minutes and retry until it works : 
    >>> kvm_instance = request(kvm, "fourth_kvm",
    partition_parameter_kw={"nbd_ip":"2a01:e35:2e27:460:e2cb:4eff:fed9:48dc", 
    "nbd_port":"1024"},
    filter_kw={ "computer_guid": "COMP-12345" })
    >>> kvm_instance.getState()
    Started
    >>> kvm_instance.getConnectionParameter('url')
    [URL appears here]
    >>> kvm_instance.getConnectionParameter('password')
    [Password appears here]
  

Slapconsole allows your to interact with the SlapOS Master using the SLAP API.

Replace the COMP-12345 by your Computer ID.

Launch slapconsole, then ask the Master to deploy an instance of your software. First, it will raise an exception meaning that the instance is not ready yet.

You will have to wait until the instance is ready. From time to time, run again the same command to fetch up-to-date informations.

When it does not longer throw an exception, your instance is ready. You can then fetch the informations you need to connect to your instance.

Connect with VNC

Open the url with your browser (recent Chrome/Chromium is preferred). Make sure the ipv6 part is correctly filled in the form ("[" characters can be altered), paste the password, then connect.

Next Steps

How to Contribute?

  • Publish your own NBD
  • Extend kvm to support parameters
  • Add your software to SlapOS
  • Add functionnalities to the core of SlapOS