2323import org .apache .cloudstack .framework .config .ConfigKey ;
2424
2525import com .cloud .agent .api .Command ;
26+ import com .cloud .agent .api .to .DataStoreTO ;
2627import com .cloud .agent .api .to .NicTO ;
2728import com .cloud .agent .api .to .VirtualMachineTO ;
2829import com .cloud .hypervisor .Hypervisor .HypervisorType ;
@@ -101,21 +102,20 @@ boolean attachRestoredVolumeToVirtualMachine(long zoneId, String location, Backu
101102 * Will generate commands to migrate a vm to a pool. For now this will only work for stopped VMs on Vmware.
102103 *
103104 * @param vm the stopped vm to migrate
104- * @param destination the primary storage pool to migrate to
105+ * @param volumeToPool the primary storage pools to migrate to
105106 * @return a list of commands to perform for a successful migration
106107 */
107108 List <Command > finalizeMigrate (VirtualMachine vm , Map <Volume , StoragePool > volumeToPool );
108109
109110
110111 /**
111- * Will perform a clone of a VM on an external host (if the guru can handle)
112+ * Will return the hypervisor VM (clone VM for PowerOn VMs), performs a clone of a VM if required on an external host (if the guru can handle)
112113 * @param hostIp VM's source host IP
113- * @param vmName name of the source VM to clone from
114+ * @param vmName name of the source VM ( clone VM name if cloned)
114115 * @param params hypervisor specific additional parameters
115- * @return a reference to the cloned VM
116+ * @return a reference to the hypervisor or cloned VM, and cloned flag
116117 */
117- UnmanagedInstanceTO cloneHypervisorVMOutOfBand (String hostIp , String vmName ,
118- Map <String , String > params );
118+ Pair <UnmanagedInstanceTO , Boolean > getHypervisorVMOutOfBandAndCloneIfRequired (String hostIp , String vmName , Map <String , String > params );
119119
120120 /**
121121 * Removes a VM created as a clone of a VM on an external host
@@ -124,6 +124,23 @@ UnmanagedInstanceTO cloneHypervisorVMOutOfBand(String hostIp, String vmName,
124124 * @param params hypervisor specific additional parameters
125125 * @return true if the operation succeeds, false if not
126126 */
127- boolean removeClonedHypervisorVMOutOfBand (String hostIp , String vmName ,
128- Map <String , String > params );
127+ boolean removeClonedHypervisorVMOutOfBand (String hostIp , String vmName , Map <String , String > params );
128+
129+ /**
130+ * Create an OVA/OVF template of a VM on an external host (if the guru can handle)
131+ * @param hostIp VM's source host IP
132+ * @param vmName name of the source VM to create template from
133+ * @param params hypervisor specific additional parameters
134+ * @param templateLocation datastore to create the template file
135+ * @return the created template dir/name
136+ */
137+ String createVMTemplateOutOfBand (String hostIp , String vmName , Map <String , String > params , DataStoreTO templateLocation , int threadsCountToExportOvf );
138+
139+ /**
140+ * Removes the template on the location
141+ * @param templateLocation datastore to remove the template file
142+ * @param templateDir the template dir to remove from datastore
143+ * @return true if the operation succeeds, false if not
144+ */
145+ boolean removeVMTemplateOutOfBand (DataStoreTO templateLocation , String templateDir );
129146}
0 commit comments