Example #1
0
        protected override void Run()
        {
            Description = Messages.STARTING_IN_RECOVERY_MODE;
            string oldPolicy = VM.HVM_boot_policy;
            string oldOrder  = VM.BootOrder;

            vmCopy = (VM)VM.Clone();
            vmCopy.HVM_boot_policy = "BIOS order";
            vmCopy.BootOrder = "DN";

            VM.Locked = true;
            vmCopy.SaveChanges(Session);
            VM.Locked = false;

            XenAPI.VM.start(Session, VM.opaque_ref, false, false);

            vmCopy.HVM_boot_policy = oldPolicy;
            vmCopy.BootOrder = oldOrder;

            VM.Locked = true;
            vmCopy.SaveChanges(Session);
            VM.Locked = false;

            Description = Messages.STARTED_IN_RECOVERY_MODE;
        }