       }
 
     $scope.stopVM = (id) ->
-      xo.vm.stop id
-      notify.info {
-        title: 'VM shutdown...'
-        message: 'Gracefully shutdown the VM'
-      }
+      modal.confirm
+        title: 'VM shutdown'
+        message: 'Are you sure you want to shutdown this VM ?'
+      .then ->
+        xo.vm.stop id
+        notify.info {
+          title: 'VM shutdown...'
+          message: 'Gracefully shutdown the VM'
+        }
 
     $scope.force_stopVM = (id) ->
-      xo.vm.stop id, true
-      notify.info {
-        title: 'VM force shutdown...'
-        message: 'Force shutdown the VM'
-      }
+      modal.confirm
+        title: 'VM force shutdown'
+        message: 'Are you sure you want to force shutdown for this VM ?'
+      .then ->
+        xo.vm.stop id, true
+        notify.info {
+          title: 'VM force shutdown...'
+          message: 'Force shutdown the VM'
+        }
 
     $scope.rebootVM = (id) ->
-      xo.vm.restart id
-      notify.info {
-        title: 'VM reboot...'
-        message: 'Gracefully reboot the VM'
-      }
+      modal.confirm
+        title: 'VM reboot'
+        message: 'Are you sure you want to reboot this VM ?'
+      .then ->
+        xo.vm.restart id
+        notify.info {
+          title: 'VM reboot...'
+          message: 'Gracefully reboot the VM'
+        }
 
     $scope.force_rebootVM = (id) ->
-      xo.vm.restart id, true
-      notify.info {
-        title: 'VM reboot...'
-        message: 'Force reboot the VM'
-      }
+      modal.confirm
+        title: 'VM reboot'
+        message: 'Are you sure you want to force reboot for this VM ?'
+      .then ->
+        xo.vm.restart id, true
+        notify.info {
+          title: 'VM reboot...'
+          message: 'Force reboot the VM'
+        }
 
     $scope.suspendVM = (id) ->
-      xo.vm.suspend id
-      notify.info {
-        title: 'VM suspend...'
-        message: 'Suspend the VM'
-      }
+      modal.confirm
+        title: 'VM suspend'
+        message: 'Are you sure you want to suspend this VM ?'
+      .then ->
+        xo.vm.suspend id
+        notify.info {
+          title: 'VM suspend...'
+          message: 'Suspend the VM'
+        }
 
     $scope.resumeVM = (id) ->
       xo.vm.resume id, true

    $scope.disconnectVBD = (vdi) ->
      id = resolveVBD(vdi)
      if id?
        console.log "Disconnect VBD #{id}"
        xo.vbd.disconnect id

    $scope.connectVBD = (vdi) ->
      id = resolveVBD(vdi)

      xo.vif.connect id

    $scope.disconnectVIF = (id) ->
      modal.confirm
        title: 'Disconnect VIF'
        message: 'Are you sure you want to disconnect this interface ?'
      .then ->
        console.log "Disconnect VIF #{id}"

        xo.vif.disconnect id

    $scope.deleteVIF = (id) ->
      console.log "Delete VIF #{id}"
