« Previous - Version 3/4 (diff) - Next » - Current version
ludo, 03/29/2009 04:46 PM


Create a vsite

Now that the client have been created, it is necessary to create a vsite in order to use the services.

For the records, a vsite (meaning a "virtual site") is a virtual datacenter, which includes the services (virtual machine, stockage backends, etc...)

To create a vsite :

ludovic@ZiSH:# help vsite

        vsite <vsite_name> [<sitegroup_name> <client_name>] - Enter vsite configuration commands.
ludovic@ZiSH:# vsite sous_projet_1 marseille projet_1
Vsite sous_projet_1 created

Let's take a look of the available option when creating a vsite.

  • vsite_name : it is the name which will be affected to your vsite.
  • sitegroup_name : it represents the group of physical sites on which the services (associated with the vsite) will be created

Nota : the groups actually available are : Marseille, Marseille-Paris (primary site in Marseille with full redundancy of the services in Paris)

  • client_name : to associate the vsite to a particular client

In our example, we have create a vsite named "sous_projet_1", on Marseille's site, et attached to the "projet_1" client.

Manage the vsite

It is possible to create as many vsite as you want.
In order to know the entire list of your vsite, you simply have to execute the "show vsite" command through your ZiSH client :

ludovic@ZiSH:# show vsite
sous_projet_1
sous_projet_2

To manage one of your vsite :

ludovic@ZiSH:# vsite sous_projet_1
Vsite:sous_projet_1# 

To delete one of your vsite :

ludovic@ZiSH:# no vsite sous_projet_2
ludovic@ZiSH:# show vsite
sous_projet_1

To display informations about the current vsite (attached client, sitegroup, services, etc...) :

ludovic@ZiSH:# vsite sous_projet_1
Vsite:sous_projet_1# show

Client:          projet_1
SiteGroup:       marseille

Services:

Create services (virtual machine, stockage...)

Now that the vsite have been create, we can access to the create and manage services part.
Let's start by execute the "help" command in order to list the available services :

Vsite:sous_projet_1# help

Documented commands (type help <topic>):
========================================
boot  help       ipaddress  no    shutdown  vlan
exit  interface  machine    show  storage 

Let's take a detail look on each services, and how to create them :

machine

Vsite:sous_projet_1# help machine

        machine <machine_name> - Enter machine configuration level.

To create a machine :

Vsite:sous_projet_1# machine vm1
Machine vm1 created

As usual, the "show" command will gives us all the necessary details :

Machine:sous_projet_1.vm1# show
Machine vm1 is None
  Pending: stalled (None)
  CPU: 1 x86-64bits Memory: 1024
  VNC Desactivated keymap is en-us, password is None, bound on undef:undef
  No interface attached
  No storage attached
  Member of vsite sous_projet_1

storage

Vsite:sous_projet_1# help storage

        storage <storage_name> (<size> | (clone|cloneconfig|clonedata) <storagesource>) - Add/Clone a storage.

To a create storage:

Vsite:sous_projet_1# storage hdd_vm1 20
Storage hdd_vm1 created

interface

Vsite:sous_projet_1# help interface

        interface <interface_name> - Add/Configure a network interface.

To create a network interface :

Vsite:sous_projet_1# interface eth0_vm1
Interface eth0_vm1 created
Interface:sous_projet_1.eth0_vm1# show
Interface eth0_vm1 MAC de:ad:01:00:00:0e model virtio in VLAN 2 (ielo.mars.vlan.default)
  No IP address
  In:             0 bytes,            0 packets
  Out:            0 bytes,            0 packets
  Not attached to any machine

ipaddress

Now that we have successfully created a network interface, we can make a request for a public IP address.

Vsite:sous_projet_1# help ipaddress

        ipaddress <ipaddress_name> (ipv4|ipv6) [<reverse>] - Request an ipaddress assignment (IPv4 or IPv6)

To request the public IP :

ludovic@Vsite:sous_projet_1# ipaddress ip_vm1_eth0 ipv4 fakeip.test.com
Ipaddress successfly allocated with label ip_vm1_eth0

We now have access to this IP address informations :

ludovic@Vsite:sous_projet_1# show ipaddress ip_vm1_eth0
IpAddress ip_vm1_eth0 : 85.118.58.5/24

     Reverse DNS : FAKEIP.TEST.COM.
     Address     : 85.118.58.5
     Netmask     : 255.255.255.0
     Broadcast   : 85.118.58.255
     Gateway     : 85.118.58.254
     Nameserver  : 85.118.58.253

  Not attached to any interface

As indicated bellow, this IP is not attached to any network interface. Here is how to do it :

ludovic@Interface:sous_projet_1.vm1_eth0# ipaddress ip_vm1_eth0

By executing the "show" command again, it will indicates us that this IP address have been successfully attach to the "vm1_eth0" interface.

ludovic@Vsite:sous_projet_1# show ipaddress ip_vm1_eth0
IpAddress ip_vm1_eth0 : 85.118.58.5/24

     Reverse DNS : FAKEIP.TEST.COM.
     Address     : 85.118.58.5
     Netmask     : 255.255.255.0
     Broadcast   : 85.118.58.255
     Gateway     : 85.118.58.254
     Nameserver  : 85.118.58.253

   Attached to Interface vm1_eth0 macAddr de:ad:01:00:00:87

vlan

To create a vlan :

ludovic@Vsite:sous_projet_1# vlan vlan_prod
VLAN vlan_prod created

ludovic@Vlan:sous_projet_1.vlan_prod# show
VLAN 18 (vlan_prod)
  No member interface
ludovic@Vlan:sous_projet_1.vlan_prod# help

Documented commands (type help <topic>):
========================================
exit  help  interface  no  show

It is also possible to attach a particular network interface to an existing vlan :

ludovic@Vlan:sous_projet_1.vlan_prod# interface vm1_eth0
ludovic@Vlan:sous_projet_1.vlan_prod# show
VLAN 18 (vlan_prod)
  Member interface(s):
    vm1_eth0 at de:ad:01:00:00:87

Complete example

  • Create the virtual machine
ludovic@Vsite:sous_projet_1# machine vm1
Machine vm1 created
ludovic@Machine:sous_projet_1.vm1#
ludovic@Machine:sous_projet_1.vm1# help

Documented commands (type help <topic>):
========================================
boot     exit  interface  no      shutdown  vcpu
cputype  help  memory     reboot  storage   vnc 

ludovic@Machine:sous_projet_1.vm1# show
Machine vm1 is None
  Pending: stalled (None)
  CPU: 1 x86-64bits Memory: 1024
  VNC Desactivated keymap is en-us, password is None, bound on undef:undef
  No interface attached
  No storage attached
  Member of vsite sous_projet_1
  • Create one or several stockage drive

The storage drive must be created in the vsite part :

ludovic@Vsite:sous_projet_1# storage vm1_sda 10
Storage vm1_sda created.

We can next attach it to a virtual machine :

ludovic@Machine:sous_projet_1.vm1# help storage

        storage <storage_name> [opt]...
            opt :=  ( readonly
                    | bootable
                    | bus (virtio|ide|scsi)
                    | priority <priority> )

            Add storage_name to this machine.  If bootable is specified with
            optional priority, mark device as bootable.

ludovic@Machine:sous_projet_1.vm1# storage vm1_sda
  • create one or several network interface

This creation also takes place in the vsite part...

ludovic@Vsite:sous_projet_1# interface vm1_eth0
Interface vm1_eth0 created

... et its attachment to the virtual machine :

ludovic@Machine:sous_projet_1.vm1# interface vm1_eth0
  • Changing the CPU

It is possible de make several modifications regarding the processor : increasing or decreasing the numbers of CPU attached to a machine, but also to change its type architecture (32/64 bits).

For instance, to attach two CPUs to a virtual machine :

ludovic@Machine:sous_projet_1.vm1# vcpu 2

And if we want to change their architecture :

ludovic@Machine:sous_projet_1.vm1# cputype x86-32bits

Nota : the possible options pour the CPU architecture are x86-32bits and x86-64bits.

  • Changing the memory

To modify the amount of memory on your machine :

ludovic@Machine:sous_projet_1.vm1# memory 4G

Nota: ZiSH's help shows us that it is possible to affect this value in MegaOctets : "M", or in GigaOctects : "G".

  • VNC access

The are here manyier options :

ludovic@Machine:sous_projet_1.vm1# help vnc

        vnc keymap <keymap>
        vnc password <password>
        vnc enable
        vnc disable

We can modify the VNC keymap, its password and activate or not the access.

So, if we want to active the VNC access, with an english keymap and a password :

ludovic@Machine:sous_projet_1.vm1# vnc keymap en
ludovic@Machine:sous_projet_1.vm1# vnc password fake_password
ludovic@Machine:sous_projet_1.vm1# vnc enable

Nota : the password must contain at least 8 characters.
Nota : the VNC access can only be actived unless the virtual machine is started.

Manage the service

To handle all of the services describe above, three new commands are necessary :

  • boot : allow to boot a virtual machine
Vsite:sous_projet_1# boot vm1
  • shutdown : allow to shutdown a virtual machine
Vsite:sous_projet_1# shutdown vm1
  • no : allow to delete services from the vsite, for instance :
Vsite:sous_projet_1# no interface eth0_vm1

Also available in: HTML TXT