Difference between pages "Voicemail.conf" and "Creating VMs"

From Wikislax
(Difference between pages)
Jump to: navigation, search
(Created page with "{{RightTOC}} The '''voicemail.conf''' file controls the Asterisk voicemail system. It consists of three or more main contexts. The first context, called '''[general]''', sets...")
 
(Creating a PV VM)
 
Line 1: Line 1:
 
{{RightTOC}}
 
{{RightTOC}}
  
The '''voicemail.conf''' file controls the Asterisk voicemail system. It consists of three or more main contexts. The first context, called '''[general]''', sets the system-wide settings for voicemail. It affords defining a template for voicemail messages. These messages can be sent using SMTP and the '''mailcmd''' program, and/or directly placed in the voicemail-owner imap-folder.
+
== the xl tool ==
  
[general]
+
There is a variety of tools and commands to handle virtual machines. Here we will use the Xen '''xl''' command.
 
format=wav                              ; voicemail formats to use. imap takes first only
 
servermail=nospam@studioware.com        ; who the notification should appear to come from
 
attach=yes                              ; voicemail as an attachement
 
maxsecs=180                            ; maximum seconds of a voicemail message
 
minsecs=2                              ; minimum seconds of a voicemail message to be kept
 
skipms=3000                            ; milliseconds to skip fwd/bck when ff/rew in message playback
 
maxsilence=10                          ; seconds of silence to end recording
 
silencethreshold=128                    ; what we consider silence: the lower, the more sensitive
 
maxlogins=3                            ; max number of failed login attempst
 
mailcmd=/usr/sbin/sendmail -t          ; command for outbound e-mail
 
 
; Change the from, body and/or subject, variables:
 
;    VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_CIDNUM,
 
;    VM_CIDNAME, VM_DATE
 
; Additionally, on forwarded messages, you have the variables:
 
;    ORIG_VM_CALLERID, ORIG_VM_CIDNUM, ORIG_VM_CIDNAME, ORIG_VM_DATE
 
; You can select between two variables by using dialplan functions, e.g.
 
;    ${IF(${ISNULL(${ORIG_VM_DATE})}?${VM_DATE}:${ORIG_VM_DATE})}
 
; Note: The emailbody config row can only be up to 512 characters due to a
 
;      limitation in the Asterisk configuration subsystem.
 
 
emailsubject=[ASTERISK] ${VM_MAILBOX}: nouveau message de ${VM_CIDNUM}
 
 
emailbody=Nouveau message :\n\n\tPour  : ${VM_MAILBOX}\n\tDe    : ${VM_CIDNUM}\n\tLe    : ${VM_DATE}\n\tDurée : ${VM_DUR}\n
 
 
emaildateformat=%A, %d %B %Y à %H:%M:%S
 
 
; -----------------------------------------------------------------------------
 
; IMAP configuration settings only
 
;  These settings are only applicable when Asterisk is compiled with IMAP support.
 
;
 
imapserver=inner.studioware.com ; The address of the IMAP server
 
;imapflags=ssl          ; Optional flags to pass to the IMAP server in the IMAP mailbox
 
                        ; name.  For example, setting this to 'ssl' will enable OpenSSL
 
                        ; encryption, assuming the IMAP libraries were compiled with
 
                        ; OpenSSL support.
 
authuser=postmaster    ; The master user to use for connecting to the IMAP server, if
 
                        ; the server is configured with a single user that has access to
 
                        ; all mailboxes
 
authpassword=mysecret  ; master user password
 
sendvoicemail=yes      ; Allow the user to compose and send a voicemail while inside
 
                        ; VoiceMailMain() [option 5 from mailbox's advanced menu].
 
                        ; If set to 'no', option 5 will not be listed.
 
  
The second context, called '''[zonemessages]''', affords configuring different voicemail zones, which are a collection of time and time zone settings. This context probably does not need any modification. The third '''[default]''' and following contextx affords creating one or more groups of voicemail boxes. The syntax to define a voicemail box is :
+
* '''xl create ''file''''' affords creating a virtual machine based on the configuration in file ''file''. A one-starting sequential domain id is created.
  
[default]
+
* '''xl destroy ''domid''''' affords destroying a virtual machine with domain id ''domid''. Of course using the system in the VM will be a preferred method to terminate.
. . .
 
mailbox => password,name,email,pager_email,options
 
  
* '''mailbox''' is the mailbox number.
+
* '''xl help''' affords getting more information on other xm commands.
  
* '''password''' is the numeric password that the mailbox owner will use to access her voicemail. If the user changes her password, the system will update this field directly in the file.
+
Xen supports paravirtualisation and hardware virtualization. Both can be used at the same time on a single Xen system.
  
* '''name''' is the name of the mailbox owner. The directory uses the text in this field to allow callers to spell usernames.
+
== Creating a PV VM ==
  
* '''email''' is the SMTP email address of the mailbox owner. Asterisk can send voicemail notifications (including the voicemail message itself) to the specified email box. The sending requires a working '''sendmail''' service.
+
* in paravirtualization (PV) guest operating systems are modified so they are able to interlock with Xen without emulation or virtual emulated hardware. Xen PV guest kernels exist for Linux, NetBSD, FreeBSD, OpenSolaris and Novell Netware. Upstream kernel.org Linux kernels since Linux 2.6.24 include Xen PV guest (domU) support based on the Linux pvops framework, so every upstream Linux kernel can be automatically used as Xen PV guest kernel without any additional patches or modifications.
  
* '''pager_email''' is the email address of the mailbox owner's pager or cell phone. Asterisk can send a short voicemail notification message to the specified email address.
+
Paravirtualization requires storing the kernel to boot in the dom0 filesystem, and populating the system in a virtual partition. The kernel generated must be able to manage [http://wiki.qemu.org/download/qemu-doc.html#QEMU-PC-System-emulator the QEMU devices] and include the .config file [http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs#Configuring_the_kernel domU options]. Here is a minimal example of such a [{{SERVER}}/wikislax/download/config-domU .config domU] file. The swap partition and VM filesystem can be created as below. Don't forget to update the root device in fstab :
  
* '''options''' is a list of options that set the mailbox owner's time zone and override the global voicemail settings. The options are attach, serveremail, tz, saycid, review, operator, callback, dialout, and exitcontext. These options should be in option=value pairs, separated by the pipe character (|). The tz option sets the user's time zone to a time zone previously defined in the [zonemessages] section of '''voicemail.conf'''.
+
# dd if=/dev/zero of=sl12.swp bs=1024k count=1024
 +
# mkswap sl12.swp
 +
# dd if=/dev/zero of=sl12.img bs=1024k count=8192
 +
# mkfs -t ext3 sl12.img
 +
# mkdir loop
 +
# mount -o loop sl12.img loop
 +
# cp -ax /mnt/sl12/{0,bin,boot,etc,home,initrd*,lib,lib64,media,mnt,opt,root,run,sbin,srv,sys,usr,var,vmlinuz*} loop
 +
# mkdir loop/{dev,proc,tmp}
 +
# chmod 777 loop/tmp
 +
# vi loop/etc/fstab
 +
# umount loop
 +
# dd if=/dev/zero bs=1G count=8 >> sl12.img
 +
# e2fsck -f sl12.img
 +
# resize2fs sl12.img
  
* the '''imapuser=user''' option affords entering a voice mail message directly into the locally-configured imap database, using the c-client program, and with no SMTP sending. if also specifying an email as third parameter, the message will also be sent using the program defined in '''mailcmd''', and you might be surprised to get 2 messages instead of 1 in your mailbox.
+
Then a PV config file needs to be created. Samples are available from the /etc/xen directory. Here is an [{{SERVER}}/wikislax/download/sl12 example] running in a X window for slackware 12.1 (32 bits). The main config options to modify are :
  
For a complete explanation of the parameters in the '''[general]''' and '''[zonemessages]''' contexts, refer to file '''voicemail.conf''' itself, which includes very detailed comments.
+
# Kernel image file in dom0 filesystem
 +
kernel = "/boot/vmlinuz-3.4.2-domU"
 +
# Not using any optional ramdisk
 +
#ramdisk = "/boot/initrd.gz"
 +
# Initial memory allocation (in megabytes) for the new domain.
 +
memory = 2048
 +
# A name for the new domain. All domains have to have different names,
 +
name = "sl12"
 +
# Number of virtual CPUs
 +
vcpus = 2
 +
# Define network interfaces
 +
vif = [ ' ' ]
 +
# Define disk devices. Note the device names xvda and xvdb
 +
disk = [ 'file:/mnt/xen/sl12.img,xvda1,w', 'file:/mnt/xen/sl12.swap,xvdb,w' ]
 +
# Define frame buffer device. Use sdl to view virtual machine in a window
 +
vfb = [ 'sdl=1' ]
 +
# Set root device.
 +
root = "/dev/xvda1 ro"
 +
# Window resolution additional parameters
 +
extra = "xen-fbfront.video=16,1680,1024"
 +
 
 +
The VM can then be launched with '''xl create ''file''''' :
 +
 
 +
root@inner:/etc/xen# xl create sl12
 +
Parsing config from sl12
 +
root@inner:/etc/xen#
 +
 
 +
== Creating a HVM ==
 +
 
 +
* in full hardware virtualization (HVM) guests require CPU virtualization extensions from the host CPU (Intel VT-x, AMD-V). Xen uses a modified version of Qemu to emulate full PC hardware, including BIOS, IDE disk controller, VGA graphic adapter, USB controller, network adapter etc for HVM guests. CPU virtualization extensions are used to boost performance of the emulation. Fully virtualized guests do not require kernel support, so for example Windows operating systems can be used as Xen HVM guest. Fully virtualized guests are usually slower than paravirtualized guests, because of the required emulation.
 +
 
 +
Full hardware virtualization requires only a disk image to execute in. Then a HV config file needs to be created. Samples are available from the /etc/xen directory. Here is an [{{SERVER}}/wikislax/download/win7 example] running in a X window for Windows 7. The main config options to modify are :
 +
 
 +
# Initial memory allocation (in megabytes) for the new domain.
 +
memory = 2048
 +
# A name for the new domain. All domains have to have different names,
 +
name = "win7"
 +
# Number of virtual CPUs
 +
vcpus = 4
 +
# Define network interfaces
 +
vif = [ 'type=ioemu, bridge=br0' ]
 +
# Define disk devices. Note the device names xvda and xvdb
 +
disk = [ 'file:/mnt/xen/win7.img,hda,w', 'file:/mnt/xen/win7.iso,hdc:cdrom,r' ]
 +
# enable SDL library for graphics, default = 0
 +
sdl=1
 +
# enable VNC library for graphics, default = 1
 +
vnc=0
 +
# set VNC display number, default = domid
 +
vncdisplay=7
 +
 
 +
The VM can then be launched with '''xl create ''file''''' :
 +
 
 +
root@inner:/etc/xen# xl create win7
 +
Parsing config from win7
 +
root@inner:/etc/xen#
 +
 
 +
== A little screen shot ==
 +
 
 +
The 3 VMs displayed on this slackware 13.37 dom0 are slackware 12.1, windows 7 and windows 8.
 +
 
 +
[[file:Screenshot.png]]
  
 
<br/>
 
<br/>
  
{{pFoot|[[Confbridge.conf]]|[[Main Page]]|[[Extensions.conf]]}}
+
{{pFoot|[[Using Grub2]]|[[Main Page]]|[[OpenSSL]]}}

Revision as of 22:37, 30 July 2018

the xl tool

There is a variety of tools and commands to handle virtual machines. Here we will use the Xen xl command.

  • xl create file affords creating a virtual machine based on the configuration in file file. A one-starting sequential domain id is created.
  • xl destroy domid affords destroying a virtual machine with domain id domid. Of course using the system in the VM will be a preferred method to terminate.
  • xl help affords getting more information on other xm commands.

Xen supports paravirtualisation and hardware virtualization. Both can be used at the same time on a single Xen system.

Creating a PV VM

  • in paravirtualization (PV) guest operating systems are modified so they are able to interlock with Xen without emulation or virtual emulated hardware. Xen PV guest kernels exist for Linux, NetBSD, FreeBSD, OpenSolaris and Novell Netware. Upstream kernel.org Linux kernels since Linux 2.6.24 include Xen PV guest (domU) support based on the Linux pvops framework, so every upstream Linux kernel can be automatically used as Xen PV guest kernel without any additional patches or modifications.

Paravirtualization requires storing the kernel to boot in the dom0 filesystem, and populating the system in a virtual partition. The kernel generated must be able to manage the QEMU devices and include the .config file domU options. Here is a minimal example of such a .config domU file. The swap partition and VM filesystem can be created as below. Don't forget to update the root device in fstab :

# dd if=/dev/zero of=sl12.swp bs=1024k count=1024
# mkswap sl12.swp
# dd if=/dev/zero of=sl12.img bs=1024k count=8192
# mkfs -t ext3 sl12.img
# mkdir loop
# mount -o loop sl12.img loop
# cp -ax /mnt/sl12/{0,bin,boot,etc,home,initrd*,lib,lib64,media,mnt,opt,root,run,sbin,srv,sys,usr,var,vmlinuz*} loop
# mkdir loop/{dev,proc,tmp}
# chmod 777 loop/tmp
# vi loop/etc/fstab
# umount loop
# dd if=/dev/zero bs=1G count=8 >> sl12.img
# e2fsck -f sl12.img
# resize2fs sl12.img

Then a PV config file needs to be created. Samples are available from the /etc/xen directory. Here is an example running in a X window for slackware 12.1 (32 bits). The main config options to modify are :

# Kernel image file in dom0 filesystem
kernel = "/boot/vmlinuz-3.4.2-domU"
# Not using any optional ramdisk
#ramdisk = "/boot/initrd.gz"
# Initial memory allocation (in megabytes) for the new domain.
memory = 2048
# A name for the new domain. All domains have to have different names,
name = "sl12"
# Number of virtual CPUs
vcpus = 2
# Define network interfaces
vif = [ ' ' ]
# Define disk devices. Note the device names xvda and xvdb
disk = [ 'file:/mnt/xen/sl12.img,xvda1,w', 'file:/mnt/xen/sl12.swap,xvdb,w' ]
# Define frame buffer device. Use sdl to view virtual machine in a window
vfb = [ 'sdl=1' ]
# Set root device.
root = "/dev/xvda1 ro"
# Window resolution additional parameters
extra = "xen-fbfront.video=16,1680,1024"

The VM can then be launched with xl create file :

root@inner:/etc/xen# xl create sl12
Parsing config from sl12
root@inner:/etc/xen#

Creating a HVM

  • in full hardware virtualization (HVM) guests require CPU virtualization extensions from the host CPU (Intel VT-x, AMD-V). Xen uses a modified version of Qemu to emulate full PC hardware, including BIOS, IDE disk controller, VGA graphic adapter, USB controller, network adapter etc for HVM guests. CPU virtualization extensions are used to boost performance of the emulation. Fully virtualized guests do not require kernel support, so for example Windows operating systems can be used as Xen HVM guest. Fully virtualized guests are usually slower than paravirtualized guests, because of the required emulation.

Full hardware virtualization requires only a disk image to execute in. Then a HV config file needs to be created. Samples are available from the /etc/xen directory. Here is an example running in a X window for Windows 7. The main config options to modify are :

# Initial memory allocation (in megabytes) for the new domain.
memory = 2048
# A name for the new domain. All domains have to have different names,
name = "win7"
# Number of virtual CPUs
vcpus = 4
# Define network interfaces
vif = [ 'type=ioemu, bridge=br0' ]
# Define disk devices. Note the device names xvda and xvdb
disk = [ 'file:/mnt/xen/win7.img,hda,w', 'file:/mnt/xen/win7.iso,hdc:cdrom,r' ]
# enable SDL library for graphics, default = 0
sdl=1
# enable VNC library for graphics, default = 1
vnc=0
# set VNC display number, default = domid
vncdisplay=7

The VM can then be launched with xl create file :

root@inner:/etc/xen# xl create win7
Parsing config from win7
root@inner:/etc/xen#

A little screen shot

The 3 VMs displayed on this slackware 13.37 dom0 are slackware 12.1, windows 7 and windows 8.

Screenshot.png


Using Grub2 Main Page OpenSSL