thanks very much

--------------原始邮件--------------
发件人:"Liran Rotenberg "<lrote...@redhat.com&gt;;
发送时间:2020年11月5日(星期四) 晚上11:52
收件人:"lifuqi...@sunyainfo.com" <lifuqi...@sunyainfo.com&gt;;
抄送:"users "<users@ovirt.org&gt;;"devel "<de...@ovirt.org&gt;;
主题:[ovirt-devel] Re: Host's status how to change to UP when I execute 
Management--&gt; Active command
-----------------------------------

 Hi,The engine will monitor that host. Once it's reachable and we can get 
information&nbsp;from it the status will change accordingly.
Please check out the HostMonitoring class.


On Thu, Nov 5, 2020 at 11:57 AM lifuqi...@sunyainfo.com 
<lifuqi...@sunyainfo.com&gt; wrote:

 

Hi,&nbsp;
&nbsp; &nbsp; I checkout ovirt-engine's code with branch 4.2; &nbsp;When 
execute Host's Management --&gt; Active &nbsp;command, &nbsp;ovirt engine just 
set vds's status to "Unassigned" but how the vds's status changed to "UP" in 
ovirt-engine?&nbsp; The code in ActiveVdsCommand.executeCommand() as follows:
protected void executeCommand() {


&nbsp; &nbsp; &nbsp; &nbsp; final VDS vds = getVds();
&nbsp; &nbsp; &nbsp; &nbsp; try (EngineLock monitoringLock = 
acquireMonitorLock("Activate host")) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
executionHandler.updateSpecificActionJobCompleted(vds.getId(), 
ActionType.MaintenanceVds, false);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
setSucceeded(setVdsStatus(VDSStatus.Unassigned).getSucceeded());


&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (getSucceeded()) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
TransactionSupport.executeInNewTransaction(() -&gt; {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // set 
network to operational / non-operational
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
List<Network&gt; networks = networkDao.getAllForCluster(vds.getClusterId());
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
networkClusterHelper.setStatus(vds.getClusterId(), networks);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 
null;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });


&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Start glusterd 
service on the node, which would haven been stopped due to maintenance
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if 
(vds.getClusterSupportsGlusterService()) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
runVdsCommand(VDSCommandType.ManageGlusterService,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; new GlusterServiceVDSParameters(vds.getId(), 
Arrays.asList("glusterd"), "restart"));
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
starting vdo service
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
GlusterStatus isRunning = glusterUtil.isVDORunning(vds.getId());
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; switch 
(isRunning) {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case DOWN:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; log.info("VDO service is down in host : '{}' with id '{}', starting VDO 
service",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vds.getHostName(),
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vds.getId());
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; startVDOService(vds);
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; break;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case UP:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; log.info("VDO service is up in host : '{}' with id '{}', skipping 
starting of VDO service",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vds.getHostName(),
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vds.getId());
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp;break;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; case 
UNKNOWN:
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; log.info("VDO service is not installed host : '{}' with id '{}', 
ignoring to start VDO service",
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vds.getHostName(),
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vds.getId());
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; break;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }


&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; }

 



Your Sincerely
Mark Lee
 
_______________________________________________
 Devel mailing list -- de...@ovirt.org
 To unsubscribe send an email to devel-le...@ovirt.org
 Privacy Statement: https://www.ovirt.org/privacy-policy.html
 oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
 List Archives: 
https://lists.ovirt.org/archives/list/de...@ovirt.org/message/36745S77NLH3KINTB4MQMGTBE5EDWTUW/
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/VPGD6TUF5UE22NZUFUPXIGG6W5KO7OA7/

Reply via email to