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
d8c741f5
Commit
d8c741f5
authored
Dec 22, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display when VM is managed by HA, cleanups
parent
dbdd8666
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
68 deletions
+20
-68
HAConfig.pm
PVE/API2/HAConfig.pm
+5
-63
OpenVZ.pm
PVE/API2/OpenVZ.pm
+9
-1
StatusView.js
www/manager/openvz/StatusView.js
+3
-2
StatusView.js
www/manager/qemu/StatusView.js
+3
-2
No files found.
PVE/API2/HAConfig.pm
View file @
d8c741f5
...
...
@@ -220,64 +220,6 @@ my $update_cluster_conf_new = sub {
cfs_write_file
('
cluster.conf.new
',
$conf
);
};
my
$lookup_cluster_sec
=
sub
{
my
(
$conf
)
=
@_
;
die
"
no cluster defined
\n
"
if
!
PVE::Cluster::
cluster_conf_version
(
$conf
);
my
$cluster
=
$conf
->
{
children
}
->
[
0
];
die
"
invalid root node
\n
"
if
$cluster
->
{
text
}
ne
'
cluster
';
return
$cluster
;
};
my
$lookup_rm_sec
=
sub
{
my
(
$conf
,
$create
,
$noerr
)
=
@_
;
my
$cluster
=
&
$lookup_cluster_sec
(
$conf
);
my
$rmsec
;
foreach
my
$child
(
@
{
$cluster
->
{
children
}})
{
if
(
$child
->
{
text
}
eq
'
rm
')
{
$rmsec
=
$child
;
}
}
if
(
!
$rmsec
)
{
if
(
!
$create
)
{
return
undef
if
$noerr
;
die
"
no resource manager section
\n
";
}
$rmsec
=
{
text
=>
'
rm
'
};
push
@
{
$cluster
->
{
children
}},
$rmsec
;
}
return
$rmsec
;
};
my
$lookup_pvevm
=
sub
{
my
(
$conf
,
$create
,
$vmid
)
=
@_
;
my
$rmsec
=
&
$lookup_rm_sec
(
$conf
,
$create
);
my
$vmref
;
foreach
my
$child
(
@
{
$rmsec
->
{
children
}})
{
if
(
$child
->
{
text
}
eq
'
pvevm
'
&&
$child
->
{
vmid
}
eq
$vmid
)
{
$vmref
=
$child
;
}
}
return
$vmref
if
!
$create
;
if
(
!
$vmref
)
{
$vmref
=
{
text
=>
'
pvevm
',
vmid
=>
$vmid
};
push
@
{
$rmsec
->
{
children
}},
$vmref
;
}
else
{
die
"
resource group 'pvevm:
$vmid
' already exists
\n
";
}
return
$vmref
;
};
__PACKAGE__
->
register_method
({
name
=>
'
list_groups
',
path
=>
'
groups
',
...
...
@@ -307,7 +249,7 @@ __PACKAGE__->register_method({
my
$res
=
[]
;
my
$rmsec
=
&
$lookup_rm_sec
(
$conf
,
0
,
1
);
my
$rmsec
=
PVE::Cluster::
cluster_conf_lookup_rm_section
(
$conf
,
0
,
1
);
return
$res
if
!
$rmsec
;
foreach
my
$child
(
@
{
$rmsec
->
{
children
}})
{
...
...
@@ -356,7 +298,7 @@ __PACKAGE__->register_method({
my
$conf
=
&
$read_cluster_conf_new
();
my
$pvevm
=
&
$
lookup_pvevm
(
$conf
,
1
,
$param
->
{
vmid
});
my
$pvevm
=
PVE::Cluster::
cluster_conf_
lookup_pvevm
(
$conf
,
1
,
$param
->
{
vmid
});
$pvevm
->
{
autostart
}
=
$param
->
{
autostart
}
?
1
:
0
;
...
...
@@ -411,7 +353,7 @@ __PACKAGE__->register_method({
my
$conf
=
&
$read_cluster_conf_new
();
my
$pvevm
=
&
$
lookup_pvevm
(
$conf
,
0
,
$vmid
);
my
$pvevm
=
PVE::Cluster::
cluster_conf_
lookup_pvevm
(
$conf
,
0
,
$vmid
);
$pvevm
->
{
autostart
}
=
$param
->
{
autostart
}
?
1
:
0
;
...
...
@@ -452,7 +394,7 @@ __PACKAGE__->register_method({
my
$conf
=
&
$read_cluster_conf_new
();
if
(
my
$rmsec
=
&
$lookup_rm_sec
(
$conf
,
0
,
1
))
{
if
(
my
$rmsec
=
PVE::Cluster::
cluster_conf_lookup_rm_section
(
$conf
,
0
,
1
))
{
foreach
my
$child
(
@
{
$rmsec
->
{
children
}})
{
if
(
$child
->
{
text
}
eq
'
pvevm
')
{
my
$id
=
"
$child
->{text}:
$child
->{vmid}
";
...
...
@@ -502,7 +444,7 @@ __PACKAGE__->register_method({
my
$conf
=
&
$read_cluster_conf_new
();
my
$found
;
if
(
my
$rmsec
=
&
$lookup_rm_sec
(
$conf
,
0
,
1
))
{
if
(
my
$rmsec
=
PVE::Cluster::
cluster_conf_lookup_rm_section
(
$conf
,
0
,
1
))
{
my
$oldlist
=
$rmsec
->
{
children
};
$rmsec
->
{
children
}
=
[]
;
foreach
my
$child
(
@$oldlist
)
{
...
...
PVE/API2/OpenVZ.pm
View file @
d8c741f5
...
...
@@ -852,8 +852,16 @@ __PACKAGE__->register_method({
my
$conf
=
PVE::OpenVZ::
load_config
(
$param
->
{
vmid
});
my
$vmstatus
=
PVE::OpenVZ::
vmstatus
(
$param
->
{
vmid
});
my
$status
=
$vmstatus
->
{
$param
->
{
vmid
}};
return
$vmstatus
->
{
$param
->
{
vmid
}};
my
$cc
=
PVE::Cluster::
cfs_read_file
('
cluster.conf
');
if
(
PVE::Cluster::
cluster_conf_lookup_pvevm
(
$cc
,
0
,
$param
->
{
vmid
},
1
))
{
$status
->
{
ha
}
=
1
;
}
else
{
$status
->
{
ha
}
=
0
;
}
return
$status
;
}});
__PACKAGE__
->
register_method
({
...
...
www/manager/openvz/StatusView.js
View file @
d8c741f5
...
...
@@ -70,12 +70,13 @@ Ext.define('PVE.openvz.StatusView', {
maxmem
:
{
visible
:
false
},
swap
:
{
header
:
'
VSwap usage
'
,
required
:
true
,
renderer
:
render_swap
},
maxswap
:
{
visible
:
false
},
uptime
:
{
header
:
'
Uptime
'
,
required
:
true
,
renderer
:
PVE
.
Utils
.
render_uptime
}
uptime
:
{
header
:
'
Uptime
'
,
required
:
true
,
renderer
:
PVE
.
Utils
.
render_uptime
},
ha
:
{
header
:
'
Managed by HA
'
,
defaultValue
:
false
,
renderer
:
PVE
.
Utils
.
format_boolean
}
};
Ext
.
applyIf
(
me
,
{
cwidth1
:
150
,
height
:
179
,
height
:
200
,
rows
:
rows
});
...
...
www/manager/qemu/StatusView.js
View file @
d8c741f5
...
...
@@ -46,12 +46,13 @@ Ext.define('PVE.qemu.StatusView', {
cpus
:
{
visible
:
false
},
mem
:
{
header
:
'
Memory usage
'
,
required
:
true
,
renderer
:
render_mem
},
maxmem
:
{
visible
:
false
},
uptime
:
{
header
:
'
Uptime
'
,
required
:
true
,
renderer
:
PVE
.
Utils
.
render_uptime
}
uptime
:
{
header
:
'
Uptime
'
,
required
:
true
,
renderer
:
PVE
.
Utils
.
render_uptime
},
ha
:
{
header
:
'
Managed by HA
'
,
defaultValue
:
false
,
renderer
:
PVE
.
Utils
.
format_boolean
}
};
Ext
.
applyIf
(
me
,
{
cwidth1
:
150
,
height
:
1
45
,
height
:
1
66
,
rows
:
rows
});
...
...
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