| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 30db5d6 commit 5a062e1
25 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -301,6 +301,9 @@ | |||
| 301 | 301 | import com.cloud.vm.VirtualMachine.State; | |
| 302 | 302 | import com.cloud.vm.snapshot.VMSnapshot; | |
| 303 | 303 | ||
| 304 | + import com.cloud.utils.ssh.SSHCmdHelper; | ||
| 305 | + | ||
| 306 | + | ||
| 304 | 307 | /** | |
| 305 | 308 | * CitrixResourceBase encapsulates the calls to the XenServer Xapi process | |
| 306 | 309 | * to perform the required functionalities for CloudStack. | |
@@ -5299,6 +5302,12 @@ protected boolean setupServer(Connection conn) { | |||
| 5299 | 5302 | } | |
| 5300 | 5303 | ||
| 5301 | 5304 | com.trilead.ssh2.Session session = sshConnection.openSession(); | |
| 5305 | + | ||
| 5306 | + String cmd = "mkdir -p /opt/cloud/bin"; | ||
| 5307 | + if (!SSHCmdHelper.sshExecuteCmd(sshConnection, cmd)) { | ||
| 5308 | + throw new CloudRuntimeException("Cannot create directory /opt/cloud/bin on XenServer hosts"); | ||
| 5309 | + } | ||
| 5310 | + | ||
| 5302 | 5311 | SCPClient scp = new SCPClient(sshConnection); | |
| 5303 | 5312 | ||
| 5304 | 5313 | List<File> files = getPatchFiles(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,7 +89,7 @@ fi | |||
| 89 | 89 | ||
| 90 | 90 | ||
| 91 | 91 | ||
| 92 | - VHDUTIL="/opt/xensource/bin/vhd-util" | ||
| 92 | + VHDUTIL="/opt/cloud/bin/vhd-util" | ||
| 93 | 93 | ||
| 94 | 94 | copyvhd() | |
| 95 | 95 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,6 +78,7 @@ if [ $? -ne 0 ]; then | |||
| 78 | 78 | fi | |
| 79 | 79 | ||
| 80 | 80 | vhdfile=$localmp/${vdiuuid}.vhd | |
| 81 | + VHDUTIL="vhd-util" | ||
| 81 | 82 | ||
| 82 | 83 | if [ $type == "nfs" -o $type == "ext" ]; then | |
| 83 | 84 | dd if=/var/run/sr-mount/$sruuid/${vdiuuid}.vhd of=$vhdfile bs=2M | |
@@ -94,7 +95,7 @@ elif [ $type == "lvmoiscsi" -o $type == "lvm" -o $type == "lvmohba" ]; then | |||
| 94 | 95 | cleanup | |
| 95 | 96 | exit 0 | |
| 96 | 97 | fi | |
| 97 | - size=$(vhd-util query -s -n /dev/VG_XenStorage-$sruuid/VHD-$vdiuuid) | ||
| 98 | + size=$($VHDUTIL query -s -n /dev/VG_XenStorage-$sruuid/VHD-$vdiuuid) | ||
| 98 | 99 | if [ $? -ne 0 ]; then | |
| 99 | 100 | echo "10#can not get physical size of /dev/VG_XenStorage-$sruuid/VHD-$vdiuuid" | |
| 100 | 101 | cleanup | |
@@ -112,7 +113,7 @@ elif [ $type == "lvmoiscsi" -o $type == "lvm" -o $type == "lvmohba" ]; then | |||
| 112 | 113 | fi | |
| 113 | 114 | #in byte unit | |
| 114 | 115 | size=$((size<<21)) | |
| 115 | - vhd-util modify -s $size -n $vhdfile | ||
| 116 | + $VHDUTIL modify -s $size -n $vhdfile | ||
| 116 | 117 | if [ $? -ne 0 ]; then | |
| 117 | 118 | rm -f $vhdfile | |
| 118 | 119 | echo "11#failed to change $vhdfile physical size" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -96,7 +96,7 @@ if [ $? -ne 0 ]; then | |||
| 96 | 96 | exit 0 | |
| 97 | 97 | fi | |
| 98 | 98 | ||
| 99 | - VHDUTIL="/opt/xensource/bin/vhd-util" | ||
| 99 | + VHDUTIL="/opt/cloud/bin/vhd-util" | ||
| 100 | 100 | ||
| 101 | 101 | copyvhd() | |
| 102 | 102 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,7 +33,7 @@ if [ -z $2 ]; then | |||
| 33 | 33 | exit 3 | |
| 34 | 34 | fi | |
| 35 | 35 | ||
| 36 | - if [ ! -f /opt/xensource/bin/xenheartbeat.sh ]; then | ||
| 36 | + if [ ! -f /opt/cloud/bin/xenheartbeat.sh ]; then | ||
| 37 | 37 | printf "Error: Unable to find xenheartbeat.sh to launch\n" | |
| 38 | 38 | exit 4 | |
| 39 | 39 | fi | |
@@ -42,5 +42,5 @@ for psid in `ps -ef | grep xenheartbeat | grep -v grep | awk '{print $2}'`; do | |||
| 42 | 42 | kill $psid | |
| 43 | 43 | done | |
| 44 | 44 | ||
| 45 | - nohup /opt/xensource/bin/xenheartbeat.sh $1 $2 >/dev/null 2>/dev/null & | ||
| 45 | + nohup /opt/cloud/bin/xenheartbeat.sh $1 $2 >/dev/null 2>/dev/null & | ||
| 46 | 46 | echo "======> DONE <======" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,11 +32,11 @@ from time import localtime as _localtime, asctime as _asctime | |||
| 32 | 32 | ||
| 33 | 33 | xePath = "/opt/xensource/bin/xe" | |
| 34 | 34 | lib.setup_logging("/var/log/ovs-pvlan.log") | |
| 35 | - dhcpSetupPath = "/opt/xensource/bin/ovs-pvlan-dhcp-host.sh" | ||
| 36 | - vmSetupPath = "/opt/xensource/bin/ovs-pvlan-vm.sh" | ||
| 37 | - getDhcpIfacePath = "/opt/xensource/bin/ovs-get-dhcp-iface.sh" | ||
| 38 | - pvlanCleanupPath = "/opt/xensource/bin/ovs-pvlan-cleanup.sh" | ||
| 39 | - getBridgePath = "/opt/xensource/bin/ovs-get-bridge.sh" | ||
| 35 | + dhcpSetupPath = "/opt/cloud/bin/ovs-pvlan-dhcp-host.sh" | ||
| 36 | + vmSetupPath = "/opt/cloud/bin/ovs-pvlan-vm.sh" | ||
| 37 | + getDhcpIfacePath = "/opt/cloud/bin/ovs-get-dhcp-iface.sh" | ||
| 38 | + pvlanCleanupPath = "/opt/cloud/bin/ovs-pvlan-cleanup.sh" | ||
| 39 | + getBridgePath = "/opt/cloud/bin/ovs-get-bridge.sh" | ||
| 40 | 40 | ||
| 41 | 41 | def echo(fn): | |
| 42 | 42 | def wrapped(*v, **k): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,7 +58,7 @@ if [ `xe pbd-list sr-uuid=$2 | grep -B 1 $1 | wc -l` -eq 0 ]; then | |||
| 58 | 58 | exit 0 | |
| 59 | 59 | fi | |
| 60 | 60 | ||
| 61 | - hbfile=/opt/xensource/bin/heartbeat | ||
| 61 | + hbfile=/opt/cloud/bin/heartbeat | ||
| 62 | 62 | ||
| 63 | 63 | if [ "$3" = "true" ]; then | |
| 64 | 64 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,7 +55,7 @@ mv -n /etc/cron.daily/logrotate /etc/cron.hourly 2>&1 | |||
| 55 | 55 | echo 1048576 >/proc/sys/fs/aio-max-nr | |
| 56 | 56 | ||
| 57 | 57 | # empty heartbeat | |
| 58 | - cat /dev/null > /opt/xensource/bin/heartbeat | ||
| 58 | + cat /dev/null > /opt/cloud/bin/heartbeat | ||
| 59 | 59 | # empty knownhost | |
| 60 | 60 | cat /dev/null > /root/.ssh/known_hosts | |
| 61 | 61 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ def echo(fn): | |||
| 34 | 34 | return res | |
| 35 | 35 | return wrapped | |
| 36 | 36 | ||
| 37 | - SWIFT = "/opt/xensource/bin/swift" | ||
| 37 | + SWIFT = "/opt/cloud/bin/swift" | ||
| 38 | 38 | ||
| 39 | 39 | MAX_SEG_SIZE = 5 * 1024 * 1024 * 1024 | |
| 40 | 40 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,7 +87,7 @@ if [ $? -ne 0 ]; then | |||
| 87 | 87 | exit 0 | |
| 88 | 88 | fi | |
| 89 | 89 | ||
| 90 | - VHDUTIL="/opt/xensource/bin/vhd-util" | ||
| 90 | + VHDUTIL="/opt/cloud/bin/vhd-util" | ||
| 91 | 91 | ||
| 92 | 92 | upgradeSnapshot() | |
| 93 | 93 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments