Revision ca96110b

View differences:

src/oca/java/src/org/opennebula/client/vm/VirtualMachine.java
309 309
     *
310 310
     * @param hostId The host id (hid) of the target host where
311 311
     * the VM will be instantiated.
312
     * @param enforce If it is set to true, the host capacity
313
     * will be checked, and the deployment will fail if the host is
314
     * overcommited. Defaults to false
315
     * @return If an error occurs the error message contains the reason.
316
     */
317
    public OneResponse deploy(int hostId, boolean enforce)
318
    {
319
        return client.call(DEPLOY, id, hostId, enforce);
320
    }
321

  
322
    /**
323
     * Initiates the instance of the VM on the target host.
324
     *
325
     * @param hostId The host id (hid) of the target host where
326
     * the VM will be instantiated.
312 327
     * @return If an error occurs the error message contains the reason.
313 328
     */
314 329
    public OneResponse deploy(int hostId)
315 330
    {
316
        return client.call(DEPLOY, id, hostId);
331
        return deploy(hostId, false);
317 332
    }
318 333

  
319 334
    /**
......
351 366
     * the vm.
352 367
     * @param live If true we are indicating that we want livemigration,
353 368
     * otherwise false.
369
     * @param enforce If it is set to true, the host capacity
370
     * will be checked, and the deployment will fail if the host is
371
     * overcommited. Defaults to false
354 372
     * @return If an error occurs the error message contains the reason.
355 373
     */
356
    public OneResponse migrate(int hostId, boolean live)
374
    public OneResponse migrate(int hostId, boolean live, boolean enforce)
357 375
    {
358
        return client.call(MIGRATE, id, hostId, live);
376
        return client.call(MIGRATE, id, hostId, live, enforce);
359 377
    }
360 378

  
361 379
    /**
......
661 679
     *
662 680
     * @param hostId The target host id (hid) where we want to migrate
663 681
     * the vm.
682
     * @param enforce If it is set to true, the host capacity
683
     * will be checked, and the deployment will fail if the host is
684
     * overcommited. Defaults to false
685
     * @return If an error occurs the error message contains the reason.
686
     */
687
    public OneResponse migrate(int hostId, boolean enforce)
688
    {
689
        return migrate(hostId, false, enforce);
690
    }
691

  
692
    /**
693
     * Migrates the virtual machine to the target host (hid).
694
     * <br/>
695
     * It does the same as {@link VirtualMachine#migrate(int, boolean)}
696
     * with live set to false.
697
     *
698
     * @param hostId The target host id (hid) where we want to migrate
699
     * the vm.
664 700
     * @return If an error occurs the error message contains the reason.
665 701
     */
666 702
    public OneResponse migrate(int hostId)
......
677 713
     *
678 714
     * @param hostId The target host id (hid) where we want to migrate
679 715
     * the vm.
716
     * @param enforce If it is set to true, the host capacity
717
     * will be checked, and the deployment will fail if the host is
718
     * overcommited. Defaults to false
719
     * @return If an error occurs the error message contains the reason.
720
     */
721
    public OneResponse liveMigrate(int hostId, boolean enforce)
722
    {
723
        return migrate(hostId, true, enforce);
724
    }
725

  
726
    /**
727
     * Performs a live migration of the virtual machine to the
728
     * target host (hid).
729
     * <br/>
730
     * It does the same as {@link VirtualMachine#migrate(int, boolean)}
731
     * with live set to true.
732
     *
733
     * @param hostId The target host id (hid) where we want to migrate
734
     * the vm.
680 735
     * @return If an error occurs the error message contains the reason.
681 736
     */
682 737
    public OneResponse liveMigrate(int hostId)
683 738
    {
684
        return migrate(hostId, true);
739
        return liveMigrate(hostId, false);
685 740
    }
686 741

  
687 742
    public int state()

Also available in: Unified diff