I added two new features:
- Tag Support: you can tag your vm and backup them by selecting tags.
- vApp Support: if you are used to group vm in vApps you can select vm to backup by vApp.
/****f* interfaces/is_jumbo_capable
* NAME
* is_jumbo_capable - Test if interface is jumbo frame capable. Useful for determining VLAN capability.
* INPUTS
* $int - string containing interface name
* RESULT
* boolean - true or false
******/
function is_jumbo_capable($iface) {
$iface = trim($iface);
$capable = pfSense_get_interface_addresses($iface);
if (isset($capable['caps']['vlanmtu']))
return true;
// hack for some lagg modes missing vlanmtu, but work fine w/VLANs
if (substr($iface, 0, 4) == "lagg")
return true;
// hack for XenServer xn interfaces
if (substr($iface, 0, 2) == "xn")
return true;
return false;
}
![]() |
| It is safe to take a snapshot prior to daamge your work |
# rpm -e --nodeps $( rpm -qa | grep vmware-tools)
![]() |
| Export your VM - now you can go take some coffee |
![]() |
| Time to import your VM - now you can go take another coffee |
# yum remove kernel
# yum install kernel-xen
console=hvc0
xe vm-list name-label=[NAME-OF-YOUR-VM]
uuid ( RO) : [UUID-OF-YOUR_VM]
name-label ( RW): SOGo
power-state ( RO): halted
xe vm-param-set uuid=[UUID-OF-YOUR_VM] HVM-boot-policy="" PV-bootloader=pygrub PV-args="graphical utf-8"
xe vm-disk-list uuid=[UUID-OF-YOUR_VM]
Disk 0 VBD:
uuid ( RO) : [UUID-OF-VBD]
vm-name-label ( RO): SOGo
userdevice ( RW): 0
[...]
xe vbd-param-set uuid=[UUID-OF-VBD] bootable=true
cd /tmp
wget http://downloads.dell.com/FOLDER02994001M/1/OM-SrvAdmin-Dell-Web-LX-8.1.1-1583.XenServer65_A00.iso
mount -o loop /tmp/OM-SrvAdmin-Dell-Web-LX-8.1.1-1583.XenServer65_A00.iso /mnt
cd /mnt
./install.sh
cd ..
umount /mnt
primitive BTIER_TIER1 ocf:brick:btier \
params tier_devices="/dev/sda:/dev/sdb" \device_name="mybtierdev01"
op monitor interval="10s"
EXAMPLE OF USAGE
Assumptions:
- you are using DRBD as backing device (/dev/drbd1)
- your target iqn is iqn.2012-02.com.mysuperhasan:vdisk.lun
- your nic reserved for iscsi is eth2 and your iscsi subnet is 192.168.103.x
This is what your resource configuration in cib notation will look like:
primitive DRBD_VOLUME ocf:linbit:drbd \
params drbd_resource="DRBDRESOURCE" \
op monitor interval="29" role="Master" \
op monitor interval="31" role="Slave"
primitive ISCSI_IP ocf:heartbeat:IPaddr2 \
params ip="192.168.103.20" cidr_netmask="24" nic="eth2" \
op monitor interval="10s"
primitive ISCSI_LUN ocf:scst:SCSTLun \
params iscsi_enable="1" target_iqn="iqn.2012-02.com.mysuperhasan:vdisk.lun" iscsi_lun="0" \
path="/dev/drbd1" handler="vdisk_fileio" device_name="VDISK-LUN10" \
additional_parameters="nv_cache=1" \
op monitor interval="10s" timeout="120s"
primitive ISCSI_TGT ocf:scst:SCSTTarget \
params iscsi_enable="1" iqn="iqn.2012-02.com.mysuperhasan:vdisk.lun" \
portals="192.168.103.20" \
op monitor interval="10s" timeout="120s"
group GR_ISCSI ISCSI_TGT ISCSI_LUN ISCSI_IP
ms MS_DRBD_VOLUME DRBD_VOLUME \
meta master-max="1" master-node-max="1" clone-max="2" \
clone-node-max="1" notify="true"
colocation CO_ISCSI_ON_DRBD_VOLUME inf: GR_ISCSI MS_DRBD_VOLUME:Master
order OR_DRBD_BEFORE_ISCSI inf: MS_DRBD_VOLUME:promote GR_ISCSI:start
INFINIBAND:
For now infiniband support is using one target per HCA model, with SCST auto-created target names.
Soon it will be ported in one target per per mode, with target names represented by HCA port GUID
The CIB for infiniband looks like this:
primitive ISCSI_LUN ocf:scst:SCSTLun \
params target_iqn="iqn.2012-02.com.mysuperhasan:vdisk.lun" lun="0" \
path="/dev/drbd1" handler="vdisk_fileio" device_name="VDISK-LUN10" \
srpt_enable=1 additional_parameters="nv_cache=1" \
op monitor interval="10s" timeout="120s"
primitive ISCSI_TGT ocf:scst:SCSTTarget \
params iqn="iqn.2012-02.com.mysuperhasan:vdisk.lun" \
portals="192.168.103.20" \
srpt_enable=1 \
op monitor interval="10s" timeout="120s"
nslookup trick.local
Server: 192.168.98.101
Address: 192.168.98.101#53
Non-authoritative answer:
Name: trick.local
Address: 192.168.99.101
Nel caso non risolvesse, c'è da controllare la configurazione DNS.[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = BRICK.LOCAL
dns_lookup_realm = true
dns_lookup_kdc = true
[realms]
BRICK.LOCAL = {
kdc = brick.local:88
admin_server = brick.local:749
default_domain = brick.local
}
TRICK.LOCAL = {
kdc = trick.local:88
admin_server = trick.local:749
default_domain = trick.local
}
[domain_realm]
.brick.local = BRICK.LOCAL
brick.local = BRICK.LOCAL
.trick.local = TRICK.LOCAL
trick.local = TRICK.LOCAL
[kdc]
profile = /var/kerberos/krb5kdc/kdc.conf
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
auth_username_format =%Ln@%Ud/etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:/var/vmail/%Ld/%Ln/Maildir
/etc/dovecot/conf.d/auth-system.conf.ext
userdb {
driver = static
args = uid=500 gid=500 home=/var/vmail/%Ld/%Lu/Maildir allow_all_users=yes
}
node isan01 \
attributes standby="off"
node isan02 \
attributes standby="off"
primitive DRBD_VG1 ocf:linbit:drbd \
params drbd_resource="ISCSIVG1" \
op monitor interval="29" role="Master" \
op monitor interval="31" role="Slave"
primitive ISCSI_IP1 ocf:heartbeat:IPaddr2 \
params ip="192.168.100.20" \
op monitor interval="10s"
primitive ISCSI_LUN_LUN10 ocf:scst:SCSTLun \
params target_iqn="iqn.2012-02.com.
isan:vdisk.lun10" lun="0" path="/dev/drbd/by-res/DRBD_VG1" handler="vdisk_fileio" device_name="VDISK-LUN10" additional_parameters="nv_ cache=1" \ op monitor interval="10s"primitive ISCSI_TGT_LUN10 ocf:scst:SCSTTarget \ params iqn="iqn.2012-02.com.isan: vdisk.lun10" portals="192.168.100.20" \ op monitor interval="10s" timeout="60s"group GR_ISCSIVG1 ISCSI_TGT_LUN10 ISCSI_LUN_LUN10 ISCSI_IP1 ms MS_DRBD_VG1 DRBD_VG1 \ meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"colocation CO_ISCSI_ON_DRBD_VG1 inf: GR_ISCSIVG1 MS_DRBD_VG1:Master order OR_TARGET_BEFORE_VG1 inf: CL_ISCSI_TGT_LUN1:start GR_ISCSIVG1:start order OR_DRBD_BEFORE_VG1 inf: MS_DRBD_VG1:promote GR_ISCSIVG1:startproperty $id="cib-bootstrap-options" \ dc-version="1.0.9- da7075976b5ff0bee71074385f8fd0 2f296ec8a3" \ cluster-infrastructure=" openais" \ expected-quorum-votes="2" \ stonith-enabled="false" \ no-quorum-policy="ignore" \ default-action-timeout="240"rsc_defaults $id="rsc-options" \ resource-stickiness="200"
brick01# lsscsi [1:0:0:0] cd/dvd PLDS DVD+-RW DS-8W2S 1D11 /dev/sr0
[2:0:0:0] disk Generic STORAGE DEVICE 0207 /dev/sda
[3:0:32:0] enclosu DP BACKPLANE 1.05 -
[3:2:0:0] disk DELL PERC 6/i 1.21 /dev/sdb
[4:0:0:0] tape IBM ULTRIUM-TD4 97F0 -
brick01#echo "scsi add-single-device 4:0:0:1" > /proc/scsi/scsibrick01# lsscsi
[1:0:0:0] cd/dvd PLDS DVD+-RW DS-8W2S 1D11 /dev/sr0
[2:0:0:0] disk Generic STORAGE DEVICE 0207 /dev/sda
[3:0:32:0] enclosu DP BACKPLANE 1.05 -
[3:2:0:0] disk DELL PERC 6/i 1.21 /dev/sdb
[4:0:0:0] tape IBM ULTRIUM-TD4 97F0 -
[4:0:0:1] mediumx DELL PV-124T 0075 -
brick01#modprobe scst_tape
brick01#modprobe scst_changer
brick01# scstadmin -open_dev 4:0:0:0 -handler dev_tape_perf
brick01# scstadmin -open_dev 4:0:0:1 -handler dev_changer
brick01# scstadmin -add_target iqn.2012-03.com.brick:vsan.tape -driver iscsi
brick01# scstadmin -add_lun 0 -target iqn.2012-03.com.brick:vsan.tape -device 4:0:0:0 -driver iscsi
brick01# scstadmin -add_lun 1 -target iqn.2012-03.com.brick:vsan.tape -device 4:0:0:1 -driver iscsi
brick01# scstadmin -enable_target iqn.2012-03.com.brick:vsan.tape -driver iscsi
#File /etc/scst.conf
HANDLER dev_changer {
DEVICE 4:0:0:1
}
HANDLER dev_tape_perf {
DEVICE 4:0:0:0
}
TARGET_DRIVER iscsi {
enabled 1
TARGET iqn.2012-03.com.brick:vsan.tape {
enabled 1
rel_tgt_id 1
LUN 0 4:0:0:0
LUN 1 4:0:0:1
}
}
Innanzitutto, per il corretto funzionamento di mpop è necessario:
- Localizzare correttamente la directory Pickup di Exchange (Per sapere qual è vi rimando all'articolo sulla KB Microsoft KB 822933)
- Che gli indirizzi di posta associati alle cassette postali POP3 siano configurati su degli utenti esistenti sul sistema (ovvero se alla cassetta postale POP3 corrisponde l'indirizzo mailbox_1@mypop3.com lo stesso indirizzo deve esistere nella scheda "Indirizzi di Posta Elettronica" di un utente Active Directory)
Scarichiamo mpop per windows, estraiamo il file mpop.exe dall'archivio zip e mettiamolo su disco (io l'ho messo in C:\progs\mpop), creiamo poi il file di configurazione, chiamiamolo mpoprc.txt:
#File C:\progs\mpop\mpoprc.txt
defaults
# Disattivo TLS (nel mio caso utilizzo un server POP3 senza supporto per autenticazione sicura).
tls off
tls_starttls off
# Giro i messaggi nella directory Pickup di Exchange:
delivery exchange "C:\Programmi\Exchsrvr\Mailroot\vsi 1\PickUp"
# Nel mio caso ho due mailbox
account mailbox_1
# Imposto l'autenticazione
auth user
host mail.mypop3.com
user user_1
password lamiapassword
#Creo un secondo account, copia del primo, e cambio solo nome utente e password
account mailbox_2 : mailbox_1
user user_2
password lamiapassword_2
# Imposto un account di default (anche se non è necessario)
account default : mailbox_1
Per comodità creiamo un file batch, chiamiamolo mpopretrieve.cmd:
REM file c:\progs\mpop\mpopretrieve.cmd
In questo modo diciamo a mpop di leggere la configurazione dal file mpoprc.txt e di scaricare i messaggi da tutti gli account POP. Reindirizziamo poi l'output del comando sul file mpopout.txt.
Per testare il funzionamento, eseguiamo il file mpopretrieve.cmd. A esecuzione completata possiamo aprire il file mpopout.txt e visualizzare l'output:
mailbox_1 at mail.mypop3.com:
new: 1 message in 6.88 KiB, total: 1 message in 6.88 KiB
retrieving message 1 of 1 (6.88 KiB): 0%...100
mailbox_2 at mail.mypop3.com:
new: 1 message in 6.88 KiB, total: 1 message in 6.88 KiB
retrieving message 1 of 1 (6.88 KiB): 0%...100
Controlliamo poi in OWA o in Outlook se l'utente o gli utenti han ricevuto messaggi.
Se tutto è ok, possiamo pianificare l'esecuzione di mpopretrieve.cmd con le Operazioni Pianificate o il nostro scheduler preferito.
[SOGo]
name=Inverse SOGo repository
baseurl=http://inverse.ca/downloads/SOGo/RHEL6/$basearch
gpgcheck=0
[SOGo]
name=Inverse SOGo repository
baseurl=http://inverse.ca/downloads/SOGo/CentOS5/$basearch
gpgcheck=0
yum install yum-protectbase
#Aggiungere nella sezione base
#[base]
protect=1
#Aggiungere nella sezione updates
#[update]
protect=1
#Aggiungere nella sezione rpmforge-base
#[rpmforge-base]
exclude=memcached*
yum install mysql-server
[mysqld]
character_set_server=utf8
character_set_client=utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
service mysqld start
mysql
CREATE DATABASE sogo CHARSET='UTF8';
GRANT ALL PRIVILEGES ON sogo.* @'localhost' IDENTIFIED BY 'sogopassword';
quit;
yum install sogo
yum install sope49-gdl1-mysql;
su - sogo
defaults write sogod SOGoTimeZone "Europe/Rome"
defaults write sogod SOGoMailDomain "brick.local"
defaults write sogod SOGoLanguage Italian
defaults write sogod SOGoAppointmentSendEMailNotifications YES
defaults write sogod SOGoFoldersSendEMailNotifications YES
defaults write sogod SOGoACLsSendEMailNotifications YES
exit
su - sogo
defaults write sogod SOGoUserSources '({type=ldap; CNFieldName = cn; IDFieldName = cn; UIDFieldName = sAMAccountName; baseDN = "dc=brick,dc=local"; bindDN = "adquery@brick.local"; bindFields = (sAMAccountName); bindPassword = password; canAuthenticate = YES; displayName = "Active Directory"; hostname = brick.local; id = directory; isAddressBook = YES; port = 389;});'
exit
su - sogo
defaults write sogod SOGoProfileURL 'mysql://sogo:sogopassword@localhost:3306/sogo/sogo_user_profile'
defaults write sogod OCSFolderInfoURL 'mysql://sogo:sogopassword@localhost:3306/sogo/sogo_folder_info'
defaults write sogod OCSSessionsFolderURL 'mysql://sogo:sogopassword@localhost:3306/sogo/sogo_sessions_folder'
exit
su - sogo
defaults write sogod SOGoMailingMechanism smtp
defaults write sogod SOGoSMTPServer localhost
su - sogo
defaults write sogod SOGoDraftsFolderName Drafts
defaults write sogod SOGoSentFolderName Sent
defaults write sogod SOGoTrashFolderName Trash
defaults write sogod SOGoIMAPServer localhost
exit
su - sogo
defaults write sogod SOGoSuperUsernames "(Administrator)"
RequestHeader set "x-webobject-server-port" "80"
RequestHeader set "x-webobject-server-name" "sogoserver"
RequestHeader set "x-webobject-server-url" "http://sogoserver"
service sogod start
service httpd start
chkconfig mysqld on
chkconfig sogod on
chkconfig httpd on
yum install postfix dovecot krb5-workstation pam-krb5
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = BRICK.LOCAL
dns_lookup_realm = true
dns_lookup_kdc = true
[realms]
BRICK.LOCAL = {
kdc = brick.local:88
admin_server = brick.local:749
default_domain = brick.local
}
[domain_realm]
.brick.local = BRICK.LOCAL
brick.local = BRICK.LOCAL
[kdc]
profile = /var/kerberos/krb5kdc/kdc.conf
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
Ho messo nel campo kdc il nome di dominio perché nella configurazione standard del DNS di Active directory al nome di dominio corrisponde il primo Domain Controller disponibile. Provate con il comando "nslookup brick.local"
host -t any _kerberos._tcp.brick.localkinit testuser
auth sufficient pam_krb5.so no_user_check validate
account sufficient pam_permit.so
useradd vmail -m -s /sbin/nologin -d /var/vmail
getent passwd | grep vmail
vmail:x:501:501:/var/vmail:/sbin/nologin
protocols = imap
auth_username_format = %Lu
auth_debug = yes
disable_plaintext_auth = no
ssl_disable = yes
mail_location = maildir:/var/vmail/%n/Maildir
first_valid_uid = 501
last_valid_uid = 501
first_valid_gid = 501
last_valid_gid = 501
valid_chroot_dirs = /var/vmail
protocol lda {
#L'indirizzo del Postmaster per il Local Delivery
postmaster_address = administrator@brick.local
}
auth default {
mechanisms = plain login
passdb pam {
}
userdb static {
args = uid=501 gid=501 home=/var/vmail/%Lu/Maildir/ allow_all_users=yes
}
socket listen {
client {
#Parametri per dovecot-sasl, Postfix utilizza dovecot per inziare una sessione SMTP autenticata
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
master {
#Impostazioni per LDA
path = /var/run/dovecot/auth-master
mode = 0600
user = vmail
group = vmail
}
}
}
File /etc/dovecot/conf.d/10-auth.conf
auth_username_format = %Lu
auth_debug = yes
ssl = no
first_valid_uid = 501
last_valid_uid = 501
first_valid_gid = 501
last_valid_gid = 501
File /etc/dovecot/conf.d/auth-system.conf.ext
passdb {
driver = pam
}
userdb {
driver = static
args = uid=501 gid=501 home=/var/vmail/%Lu allow_all_users=yes
}
File /etc/dovecot/conf.d/10-master.conf
service auth {
unix_listener auth-userdb {
mode = 0600
user = vmail
group = vmail
}
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
}
File /etc/dovecot/conf.d/15-lda.conf
postmaster_address = administrator@brick.local
service dovecot start
telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
* OK Dovecot ready.
a LOGIN testuser testpassword
a OK Logged in.
a EXAMINE INBOX
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS ()] Read-only mailbox.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1307972331] UIDs valid
* OK [UIDNEXT 1] Predicted next UID
a OK [READ-ONLY] Select completed.
a LOGOUT
* BYE Logging out
a OK Logout completed.
Connection closed by foreign host.
server_host = brick.local
search_base = DC=brick,DC=local
bind = yes
bind_dn = adquery@brick.local
bind_pw = querypassword
query_filter = (&(objectclass=person) (mail=%s))
result_attribute = sAMAccountName
version = 3
result_format=%s/Maildir/
# Dovecot LDA
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
mynetworks_style = subnet
mynetworks = 127.0.0.0/8,192.168.98.0/24
myhostname = mail.brick.local
myorigin = $mydomain
#Autenticazione SASL (postfix utilizza dovecot, che a sua volta si appoggia a Kerberos di Active Directory
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated,reject_unauth_destination
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
# Usiamo dovecot lda per recapitare i messaggi nelle mailbox, il transport dovecot è definito nel file /etc/postfix/master.cfvirtual_transport=dovecot
dovecot_destination_recipient_limit=1
virtual_mailbox_domains = brick.local
virtual_mailbox_base = /home/vmail/
#Lo UID e il GID dell'utente vmail, ve lo siete annotati? virtual_uid_maps = static:501
virtual_gid_maps = static:501
# Controlliamo che l'indirizzo del destinatario sia valido e facciamo in modo che dovecot LDA recapiti il messaggio nella posizione corretta
virtual_alias_maps = ldap:/etc/postfix/ldap-users.cf virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
service postfix restart
telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mail.brick.local ESMTP Postfix
HELO brick.local
250 mail.brick.local
mail from brick@brick.local
250 2.1.0 Ok
RCPT TO: testuser@brick.local
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject: La vispa...
...Teresa avea tra l'erbetta a volo sorpresa gentil farfalletta ...
.
250 2.0.0 Ok: queued as A6DF511804D
quit
221 2.0.0 Bye
Connection closed by foreign host.
chkconfig dovecot on
chkconfig postfix on