23
23
import org .apache .cloudstack .framework .config .ConfigKey ;
24
24
25
25
import com .cloud .agent .api .Command ;
26
+ import com .cloud .agent .api .to .DataStoreTO ;
26
27
import com .cloud .agent .api .to .NicTO ;
27
28
import com .cloud .agent .api .to .VirtualMachineTO ;
28
29
import com .cloud .hypervisor .Hypervisor .HypervisorType ;
@@ -101,21 +102,20 @@ boolean attachRestoredVolumeToVirtualMachine(long zoneId, String location, Backu
101
102
* Will generate commands to migrate a vm to a pool. For now this will only work for stopped VMs on Vmware.
102
103
*
103
104
* @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
105
106
* @return a list of commands to perform for a successful migration
106
107
*/
107
108
List <Command > finalizeMigrate (VirtualMachine vm , Map <Volume , StoragePool > volumeToPool );
108
109
109
110
110
111
/**
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)
112
113
* @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)
114
115
* @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
116
117
*/
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 );
119
119
120
120
/**
121
121
* Removes a VM created as a clone of a VM on an external host
@@ -124,6 +124,23 @@ UnmanagedInstanceTO cloneHypervisorVMOutOfBand(String hostIp, String vmName,
124
124
* @param params hypervisor specific additional parameters
125
125
* @return true if the operation succeeds, false if not
126
126
*/
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 );
129
146
}
0 commit comments