示例#1
0
        public VDI NewDisk()
        {
            VDI vdi = new VDI();

            vdi.Connection = connection;
            vdi.read_only  = DiskTemplate != null ? DiskTemplate.read_only : false;
            vdi.SR         = new XenAPI.XenRef <XenAPI.SR>(SrListBox.SR);

            vdi.virtual_size     = Convert.ToInt64(DiskSizeNumericUpDown.Value * GetUnits());
            vdi.name_label       = NameTextBox.Text;
            vdi.name_description = DescriptionTextBox.Text;
            vdi.sharable         = DiskTemplate != null ? DiskTemplate.sharable : false;
            vdi.type             = DiskTemplate != null ? DiskTemplate.type : vdi_type.user;
            vdi.SetVmHint(TheVM != null ? TheVM.uuid : "");
            return(vdi);
        }
示例#2
0
        public VDI NewDisk()
        {
            VDI vdi = new VDI();

            vdi.Connection = connection;
            vdi.read_only  = DiskTemplate != null ? DiskTemplate.read_only : false;
            vdi.SR         = new XenAPI.XenRef <XenAPI.SR>(SrListBox.SR);

            vdi.virtual_size     = diskSpinner1.SelectedSize;
            vdi.name_label       = NameTextBox.Text;
            vdi.name_description = DescriptionTextBox.Text;
            vdi.sharable         = DiskTemplate != null ? DiskTemplate.sharable : false;
            vdi.type             = DiskTemplate != null ? DiskTemplate.type : vdi_type.user;
            vdi.SetVmHint(TheVM != null ? TheVM.uuid : "");
            return(vdi);
        }
        private VDI NewVDI(SR sr)
        {
            VDI vdi = new VDI();

            vdi.Connection       = Connection;
            vdi.read_only        = false;
            vdi.SR               = new XenRef <SR>(sr);
            vdi.virtual_size     = diskSize;
            vdi.name_label       = new FileInfo(suppPackFilePath).Name;
            vdi.name_description = Helpers.ElyOrGreater(Connection) ? Messages.UPDATE_TEMP_VDI_DESCRIPTION : Messages.SUPP_PACK_TEMP_VDI_DESCRIPTION;
            vdi.sharable         = false;
            vdi.type             = vdi_type.user;
            vdi.SetVmHint("");
            //mark the vdi as being a temporary supp pack iso
            vdi.other_config = new Dictionary <string, string> {
                { "supp_pack_iso", "true" }
            };
            return(vdi);
        }