1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00
This commit is contained in:
Pedro Dias 2015-10-26 18:07:24 +00:00
parent ee98c691e2
commit 654ef79b89
11 changed files with 47 additions and 10 deletions

View File

@ -3,7 +3,7 @@ Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin
Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync
Cmnd_Alias ONE_NET = /usr/sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /usr/sbin/ipset Cmnd_Alias ONE_NET = /usr/sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /usr/sbin/ipset
Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange
Cmnd_Alias ONE_ISCSI = /sbin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_ISCSI = /sbin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm
Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl
Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm

View File

@ -3,7 +3,7 @@ Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin
Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync
Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /usr/sbin/ipset Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /usr/sbin/ipset
Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange
Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm
Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl
Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm

View File

@ -3,7 +3,7 @@ Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin
Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync
Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /sbin/ipset Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /sbin/ipset
Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange
Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm
Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl
Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm

View File

@ -3,7 +3,7 @@ Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin
Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync Cmnd_Alias ONE_MISC = /bin/dd, /sbin/mkfs, /bin/sync
Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /sbin/ipset Cmnd_Alias ONE_NET = /sbin/brctl, /sbin/ebtables, /sbin/iptables, /sbin/ip, /sbin/ipset
Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange
Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_ISCSI = /usr/bin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm
Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl
Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm

View File

@ -3,7 +3,7 @@ Defaults:oneadmin secure_path = /sbin:/bin:/usr/sbin:/usr/bin
Cmnd_Alias ONE_MISC = /usr/bin/dd, /sbin/mkfs, /usr/bin/sync Cmnd_Alias ONE_MISC = /usr/bin/dd, /sbin/mkfs, /usr/bin/sync
Cmnd_Alias ONE_NET = /sbin/brctl, /usr/sbin/ebtables, /usr/sbin/iptables, /sbin/ip Cmnd_Alias ONE_NET = /sbin/brctl, /usr/sbin/ebtables, /usr/sbin/iptables, /sbin/ip
Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay Cmnd_Alias ONE_LVM = /sbin/lvcreate, /sbin/lvremove, /sbin/lvrename, /sbin/lvs, /sbin/vgdisplay, /sbin/lvchange
Cmnd_Alias ONE_ISCSI = /sbin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm Cmnd_Alias ONE_ISCSI = /sbin/iscsiadm, /usr/sbin/tgt-admin, /usr/sbin/tgtadm
Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl Cmnd_Alias ONE_OVS = /usr/bin/ovs-ofctl, /usr/bin/ovs-vsctl
Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm Cmnd_Alias ONE_XEN = /usr/sbin/xentop, /usr/sbin/xl, /usr/sbin/xm

View File

@ -23,7 +23,7 @@ KEYS = [:MISC , :NET , :LVM , :ISCSI , :OVS , :XEN]
CMDS = { CMDS = {
:MISC => %w(dd mkfs sync), :MISC => %w(dd mkfs sync),
:NET => %w(brctl ebtables iptables ip ipset), :NET => %w(brctl ebtables iptables ip ipset),
:LVM => %w(lvcreate lvremove lvrename lvs vgdisplay), :LVM => %w(lvcreate lvremove lvrename lvs vgdisplay lvchange),
:ISCSI => %w(iscsiadm tgt-admin tgtadm), :ISCSI => %w(iscsiadm tgt-admin tgtadm),
:OVS => %w(ovs-ofctl ovs-vsctl), :OVS => %w(ovs-ofctl ovs-vsctl),
:XEN => %w(xentop xl xm) :XEN => %w(xentop xl xm)

View File

@ -31,6 +31,7 @@ ISCSIADM=iscsiadm
LVCREATE=lvcreate LVCREATE=lvcreate
LVREMOVE=lvremove LVREMOVE=lvremove
LVRENAME=lvrename LVRENAME=lvrename
LVCHANGE=lvchange
LVS=lvs LVS=lvs
LN=ln LN=ln
MD5SUM=md5sum MD5SUM=md5sum

View File

@ -1 +1,5 @@
../common/postmigrate source /var/lib/one/remotes/scripts_common.sh
ssh_exec_and_log $1 "sudo sync; sudo lvs; sudo lvchange -an $3" "Error running fs_lvm postmigrate"
exit 0

View File

@ -1 +1,5 @@
../common/premigrate source /var/lib/one/remotes/scripts_common.sh
ssh_exec_and_log $2 "sudo sync; sudo lvs; sudo lvchange -ay $3" "Error running fs_lvm premigrate"
exit 1

View File

@ -1 +1,15 @@
../common/postmigrate DRIVER_PATH=$(dirname $0)
DISK_COUNT=$(onevm show $4 -x|grep DISK_ID| wc -l)
TMS=$(onevm show $4 -x|sed -rn 's/[[:space:]]*<TM_MAD><\!\[CDATA\[([^]]*).*/\1/p')
XPATH="${DRIVER_PATH}/../../datastore/xpath.rb -b $7"
for i in `seq 1 $DISK_COUNT`; do
TM=`echo $TMS|cut -d" " -f$i`
DISK_ID=`echo $i-1 |bc`
DEV=`ssh $1 "readlink $3/disk.$DISK_ID"`
${DRIVER_PATH}/../$TMS/postmigrate "$1" "$2" "$DEV"
done
exit 0

View File

@ -1 +1,15 @@
../common/premigrate DRIVER_PATH=$(dirname $0)
DISK_COUNT=$(onevm show $4 -x|grep DISK_ID| wc -l)
TMS=$(onevm show $4 -x|sed -rn 's/[[:space:]]*<TM_MAD><\!\[CDATA\[([^]]*).*/\1/p')
XPATH="${DRIVER_PATH}/../../datastore/xpath.rb -b $7"
for i in `seq 1 $DISK_COUNT`; do
TM=`echo $TMS|cut -d" " -f$i`
DISK_ID=`echo $i-1 |bc`
DEV=`ssh $1 "readlink $3/disk.$DISK_ID"`
${DRIVER_PATH}/../$TMS/premigrate "$1" "$2" "$DEV"
done
exit 0