Skip to content

Commit 6fc119b

Browse files
committed
adding other function e starting VFI and VBD
1 parent 7765113 commit 6fc119b

File tree

1 file changed

+137
-0
lines changed

1 file changed

+137
-0
lines changed

src/Sircamp/Xenapi/Element/XenVirtualMachine.php

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@ public function __construct($xenconnection,$name,$vmId){
1515
$this->vmId = $vmId;
1616
}
1717

18+
19+
20+
/**
21+
* Return a list of all the VMs known to the system.
22+
*
23+
* @param
24+
*
25+
* @return mixed
26+
*/
27+
public function getAll(){
28+
return $this->getXenconnection()->VM__get_all();
29+
}
30+
1831
/**
1932
* Hard Reboot a VM by passing her uuid.
2033
*
@@ -106,6 +119,23 @@ public function poolMigrate($hostRef = null, $optionsMap = array()){
106119
public function migrateSend($dest,$live = false,$vdiMap,$vifMap,$options){
107120
return $this->getXenconnection()->VM__migrate_send($this->getVmId(),$dest,$live,$vdiMap,$vifMap,$options);
108121
}
122+
123+
124+
/**
125+
* Assert whether a VM can be migrated to the specified destination.
126+
*
127+
* @param mixed $VM the uuid of VM,
128+
* $def The result of a Host.migrate receive call.
129+
* $live The Live migration
130+
* $vdiMap of source VDI to destination SR
131+
* $vifMap of source VIF to destination network
132+
* $optionsMap Extra configuration operations
133+
* @return mixed
134+
*/
135+
public function assertCanMigrate($dest,$live = false,$vdiMap,$vifMap,$options){
136+
return $this->getXenconnection()->VM__assert_can_migrate($this->getVmId(),$dest,$live,$vdiMap,$vifMap,$options);
137+
}
138+
109139
/**
110140
* Clean Reboot a VM by passing her uuid.
111141
*
@@ -470,6 +500,113 @@ public function revert($snapshotID){
470500
public function checkpoint($name){
471501
return $this->getXenconnection()->VM__checkpoint($this->getVmId(),$name);
472502
}
503+
504+
505+
/**
506+
* Set this VM’s start delay in seconds.
507+
*
508+
* @param int seconds of delay
509+
*
510+
* @return XenResponse $response
511+
*/
512+
public function setStartDelay($seconds){
513+
return $this->getXenconnection()->VM__set_start_delay($this->getVmId(),$seconds);
514+
}
515+
516+
/**
517+
* Set this VM’s start delay in seconds.
518+
*
519+
* @param int seconds of delay
520+
*
521+
* @return XenResponse $response
522+
*/
523+
public function setShutdownDelay($seconds){
524+
return $this->getXenconnection()->VM__set_shutdown_delay($this->getVmId(),$seconds);
525+
}
526+
527+
/**
528+
* Get the current operations field of the given VM.
529+
*
530+
* @param
531+
*
532+
* @return XenResponse $response
533+
*/
534+
public function getCurrentOperations(){
535+
return $this->getXenconnection()->VM__get_current_operations($this->getVmId());
536+
}
537+
538+
/**
539+
* Get the allowed operations field of the given VM.
540+
*
541+
* @param
542+
*
543+
* @return XenResponse $response
544+
*/
545+
public function getAllowedOperations(){
546+
return $this->getXenconnection()->VM__get_allowed_operations($this->getVmId());
547+
}
548+
549+
550+
551+
/**
552+
* Get the name/description field of the given VM.
553+
*
554+
* @param
555+
*
556+
* @return XenResponse $response
557+
*/
558+
public function getNameDescription(){
559+
return $this->getXenconnection()->VM__get_name_description($this->getVmId());
560+
}
561+
562+
/**
563+
* Set the name/description field of the given VM.
564+
*
565+
* @param string name
566+
*
567+
* @return XenResponse $response
568+
*/
569+
public function setNameDescription($name){
570+
return $this->getXenconnection()->VM__set_name_description($this->getVmId(),$name);
571+
}
572+
573+
/**
574+
* Get the is a template field of the given VM.
575+
*
576+
* @param
577+
*
578+
* @return XenResponse $response
579+
*/
580+
public function getIsATemplate(){
581+
return $this->getXenconnection()->VM__get_is_a_template($this->getVmId());
582+
}
583+
584+
/**
585+
* Set the is a template field of the given VM.
586+
*
587+
* @param bool $template
588+
*
589+
* @return XenResponse $response
590+
*/
591+
public function setIsATemplate($template){
592+
return $this->getXenconnection()->VM__set_is_a_template($this->getVmId(),$template);
593+
}
594+
595+
596+
597+
/**
598+
* Get the resident on field of the given VM.
599+
*
600+
* @param
601+
*
602+
* @return XenResponse $response
603+
*/
604+
public function getResidentOn(){
605+
return $this->getXenconnection()->VM__get_resident_on($this->getVmId());
606+
}
607+
608+
609+
473610
}
474611
?>
475612

0 commit comments

Comments
 (0)