Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
4e4ee68e
Commit
4e4ee68e
authored
Apr 12, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 158: move openvz scripts inside ocf resource agent
parent
f590883a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
2 deletions
+54
-2
pvevm
bin/ocf/pvevm
+47
-1
changelog.Debian
debian/changelog.Debian
+6
-0
defines.mk
defines.mk
+1
-1
No files found.
bin/ocf/pvevm
View file @
4e4ee68e
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
# Copyright (C) 2011 Proxmox Server Solutions GmbH
# Copyright (C) 2011 Proxmox Server Solutions GmbH
use
strict
;
use
strict
;
use
File::
Copy
;
use
PVE::
Tools
;
use
PVE::
Tools
;
use
PVE::
ProcFSTools
;
use
PVE::
ProcFSTools
;
use
PVE::
Cluster
;
use
PVE::
Cluster
;
...
@@ -150,6 +151,35 @@ sub upid_wait {
...
@@ -150,6 +151,35 @@ sub upid_wait {
}
}
}
}
sub
copy_scripts
{
my
(
$vmid
,
$oldconfig
,
$newconfig
)
=
@_
;
my
$oldcfgdir
=
dirname
(
$oldconfig
);
my
$newcfgdir
=
dirname
(
$newconfig
);
my
$newfiles
=
[]
;
my
$oldfiles
=
[]
;
eval
{
foreach
my
$s
(
PVE::OpenVZ::
SCRIPT_EXT
)
{
my
$scriptfn
=
"
${vmid}
.
$s
";
my
$oldfn
=
"
$oldcfgdir
/
$scriptfn
";
next
if
!
-
f
$oldfn
;
my
$dstfn
=
"
$newcfgdir
/
$scriptfn
";
push
@$oldfiles
,
$oldfn
;
push
@$newfiles
,
$dstfn
;
copy
(
$oldfn
,
$dstfn
)
||
die
"
copy '
$oldfn
' to '
$dstfn
' failed - $!
\n
";
}
};
if
(
my
$err
=
$@
)
{
foreach
my
$fn
(
@$newfiles
)
{
unlink
(
$fn
);
}
die
$err
;
}
return
(
$newfiles
,
$oldfiles
);
}
my
$cmd
=
shift
||
'';
my
$cmd
=
shift
||
'';
my
$migratetarget
=
shift
if
$cmd
eq
'
migrate
';
my
$migratetarget
=
shift
if
$cmd
eq
'
migrate
';
...
@@ -164,18 +194,34 @@ if ($cmd eq 'start') {
...
@@ -164,18 +194,34 @@ if ($cmd eq 'start') {
if
(
$status
->
{
node
}
ne
$nodename
)
{
if
(
$status
->
{
node
}
ne
$nodename
)
{
ocf_log
('
info
',
"
Move config for
$status
->{name} to local node
");
ocf_log
('
info
',
"
Move config for
$status
->{name} to local node
");
my
(
$oldconfig
,
$newconfig
);
my
(
$oldconfig
,
$newconfig
,
$oldfiles
,
$newfiles
);
if
(
$status
->
{
type
}
eq
'
qemu
')
{
if
(
$status
->
{
type
}
eq
'
qemu
')
{
$oldconfig
=
PVE::QemuServer::
config_file
(
$status
->
{
vmid
},
$status
->
{
node
});
$oldconfig
=
PVE::QemuServer::
config_file
(
$status
->
{
vmid
},
$status
->
{
node
});
$newconfig
=
PVE::QemuServer::
config_file
(
$status
->
{
vmid
},
$nodename
);
$newconfig
=
PVE::QemuServer::
config_file
(
$status
->
{
vmid
},
$nodename
);
}
else
{
}
else
{
$oldconfig
=
PVE::OpenVZ::
config_file
(
$status
->
{
vmid
},
$status
->
{
node
});
$oldconfig
=
PVE::OpenVZ::
config_file
(
$status
->
{
vmid
},
$status
->
{
node
});
$newconfig
=
PVE::OpenVZ::
config_file
(
$status
->
{
vmid
},
$nodename
);
$newconfig
=
PVE::OpenVZ::
config_file
(
$status
->
{
vmid
},
$nodename
);
eval
{
(
$newfiles
,
$oldfiles
)
=
copy_scripts
(
$status
->
{
vmid
},
$oldconfig
,
$newconfig
);
};
if
(
my
$err
=
$@
)
{
ocf_log
('
err
',
"
unable to move config scripts:
$err
");
exit
(
OCF_ERR_GENERIC
);
}
}
}
if
(
!
rename
(
$oldconfig
,
$newconfig
))
{
if
(
!
rename
(
$oldconfig
,
$newconfig
))
{
ocf_log
('
err
',
"
unable to move config file from '
$oldconfig
' to '
$newconfig
' - $!
");
ocf_log
('
err
',
"
unable to move config file from '
$oldconfig
' to '
$newconfig
' - $!
");
if
(
$newfiles
)
{
foreach
my
$fn
(
@$newfiles
)
{
unlink
(
$fn
);
}
}
exit
(
OCF_ERR_GENERIC
);
exit
(
OCF_ERR_GENERIC
);
}
}
if
(
$oldfiles
)
{
foreach
my
$fn
(
@$oldfiles
)
{
unlink
(
$fn
);
}
}
}
}
my
$upid
;
my
$upid
;
...
...
debian/changelog.Debian
View file @
4e4ee68e
pve-manager (2.0-59) unstable; urgency=low
* fix bug 158: move openvz scripts inside ocf resource agent
-- Proxmox Support Team <support@proxmox.com> Thu, 12 Apr 2012 11:04:38 +0200
pve-manager (2.0-58) unstable; urgency=low
pve-manager (2.0-58) unstable; urgency=low
* fix bug #141: allow to create backup job without compression
* fix bug #141: allow to create backup job without compression
...
...
defines.mk
View file @
4e4ee68e
...
@@ -2,7 +2,7 @@ RELEASE=2.0
...
@@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
VERSION=2.0
PACKAGE=pve-manager
PACKAGE=pve-manager
PACKAGERELEASE=5
8
PACKAGERELEASE=5
9
BINDIR=${DESTDIR}/usr/bin
BINDIR=${DESTDIR}/usr/bin
PERLLIBDIR=${DESTDIR}/usr/share/perl5
PERLLIBDIR=${DESTDIR}/usr/share/perl5
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment