mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
use soft mount for secondary storage
This commit is contained in:
parent
b2f8c4bb2b
commit
c00d663df2
@ -48,7 +48,7 @@ if [ $? -ne 0 ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount -o tcp,ro $mountpoint $localmp
|
mount -o tcp,soft,ro,timeo=133,retrans=1 $mountpoint $localmp
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "6#can't mount $mountpoint to $localmp"
|
echo "6#can't mount $mountpoint to $localmp"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@ -56,7 +56,7 @@ if [ $? -ne 0 ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount -o tcp $mountpoint $localmp
|
mount -o tcp,soft,timeo=133,retrans=1 $mountpoint $localmp
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "6#can't mount $mountpoint to $localmp"
|
echo "6#can't mount $mountpoint to $localmp"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
usage() {
|
usage() {
|
||||||
printf "Usage: %s [vhd file in secondary storage] [template directory in secondary storage] \n" $(basename $0)
|
printf "Usage: %s [vhd file in secondary storage] [template directory in secondary storage] \n" $(basename $0)
|
||||||
}
|
}
|
||||||
|
options='tcp,soft,timeo=133,retrans=1'
|
||||||
cleanup()
|
cleanup()
|
||||||
{
|
{
|
||||||
if [ ! -z $snapshotdir ]; then
|
if [ ! -z $snapshotdir ]; then
|
||||||
@ -47,7 +47,7 @@ if [ $? -ne 0 ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount -o tcp $snapshoturl $snapshotdir
|
mount -o $options $snapshoturl $snapshotdir
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rmdir $snapshotdir
|
rmdir $snapshotdir
|
||||||
echo "5#can not mount $snapshoturl to $snapshotdir"
|
echo "5#can not mount $snapshoturl to $snapshotdir"
|
||||||
@ -63,7 +63,7 @@ if [ $? -ne 0 ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mount -o tcp $templateurl $templatedir
|
mount -o $options $templateurl $templatedir
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
rmdir $templatedir
|
rmdir $templatedir
|
||||||
templatedir=""
|
templatedir=""
|
||||||
|
|||||||
@ -284,9 +284,9 @@ def makedirs(path):
|
|||||||
|
|
||||||
def mount(remoteDir, localDir):
|
def mount(remoteDir, localDir):
|
||||||
makedirs(localDir)
|
makedirs(localDir)
|
||||||
|
options = "soft,tcp,timeo=133,retrans=1"
|
||||||
try:
|
try:
|
||||||
cmd = ['mount', '-o', 'tcp', remoteDir, localDir]
|
cmd = ['mount', '-o', options, remoteDir, localDir]
|
||||||
txt = util.pread2(cmd)
|
txt = util.pread2(cmd)
|
||||||
except:
|
except:
|
||||||
txt = ''
|
txt = ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user