Friday Jun 03, 2016

Oracle VM 3.4: identify orphan vdisks on repositories (find-vorph)

Identify orphan virtual-disks on repository can be a nightmare; mostly if you have more repositories and many virtual-disks to check.

  • What is it an orphan virtual-disk ?
==> An orphan virtual-disk is a virtual-device that is not associated to any virtual machine <==
  • Why do I need to identify them ?

==> Identify orphan virtual-disk can help to reclaim disk-space available on Oracle VM Repositories <==

So, like on many other examples, scripting with Oracle VM CLI can help us; here you can find a script able to identify all orphan virtual-disks; and you have two different options:

  • verify orphan virtual-disk on a specific repository
  • verify orphan virtual-disk on all repositories managed by Oracle VM Manager

The script is also able to supply the amount of disk-space recovered by deleting all orphan virtual-disks on a specific repository; output of the script will also present the Oracle VM CLI commands to execute to remove all orphan virtual-disks.

Script is compatible, able to interact and has been tested with:

  • Oracle VM 3.2
  • Oracle VM 3.3
  • Oracle VM 3.4 

Here you can find some execution examples:

  • Script executed on a specific repository (orphan virtual-disks identified and recoverable space specified)

  • Script executed on a specific repository (no orphan virtual-disks)

  • Script executed on all repositories (no repository specified)

To proceed to the setup pay attention to the README file attached to the download. 

Feedback and comments are, as always, appreciated. 

Saturday Apr 02, 2016

Oracle VM 3.4: install Oracle VM Server on EFI VirtualBox machine

Between the others, Oracle VM 3.4 introduce the option to install the Server on an EFI system.

Following steps will show how-to install Oracle VM Server 3.4.1 on a VirtualBox VM EFI based; these steps could be interesting also because new modern HW is EFI based and newest models does not accept anymore to have legacy-BIOS available.

First of all we have to create one VM dedicated to the installation; here you can find all the options selected and configuration in place:

General => Basic

  • Name: <desired VM name>
  • Type: Linux
  • Version: Oracle (64-bit) 

System => Motherboard

  • Base Memory: <desired memory amount>
  • Boot Order: <leave default>
  • Chipset: <leave default>
  • Pointing Device: <leave default>
  • Extended Features: <all selected> - see EFI

System => Processor 

  • Processor(s): <choose desired number of vcpu>
  • Execution Cap: <choose desired vcpu capacity>
  • Extended Features: <enabled>

    System => Acceleration

    • Paravirtualization Interface: Legacy
    • Hardware Virtualization: <all selected>

    Storage => Storage Tree

    • Controller: SATA
    • Devices
      • 1 vdisk dedicated to Oracle VM Server installation (I suggest 100GB dynamic vdisk)
      • virtual cd-rom with Oracle VM Server 3.4 ISO connected

    Now you can proceed to install Oracle VM Server; installation is very easy and there is no particular option to select.

    Once installed you'll see that the system, at first reboot, will automatically start the Oracle VM Server dom0; the problem really happens if you are going to stop the VM.

    In fact, once the VM stopped, if you are going to start it you'll see that the UEFI Interactive Shell v2.0 will be presented:

    To correctly boot Oracle VM Server 3.4.1 we need to specify the grub-efi configuration file with:

    fs0:\EFI\redhat\grubx64.efi

    Once Oracle VM Server 3.4 has completed the boot process we can now work to have it automatically booting.

    To have it, execute following steps:

    1. Create "startup.nsh" file (default executed on UEFI VirtualBox VM) with:
      • echo "\EFI\redhat\grubx64.efi" > /boot/efi/startup.nsh
    2. Verify that file "startup.nsh" is executable:
      • ls -l /boot/efi/startup.nsh

    Example:

    From now on, Oracle VM Server will automatically boot on this VirtualBox EFI system without any kind of interaction. 

        Thursday Mar 24, 2016

        Oracle VM 3.4: guest hot backup on different repository (v0.8)

        Not more than a couple of hours ago Oracle VM 3.4 has been announced on Virtualization Blog.

        Here you can find the new version ( 0.8 ) of the HotCloneVm.sh script.

        Download it here

        Once downloaded, you'll find a zipped file containing:

        • "SetupSsh.sh" script to setup key-based authentication to Oracle VM Manager 3 CLI
        • "HotCloneVm.sh" script to execute guests hot-backups and proceed to apply retention policies
        • "HotCloneVM.pdf" containing a real user-guide to implement this backup strategy
        • "README_FIRST.txt" containing some tips to configure ssh timeout(s)  

        Fixes introduced in 0.8:

        • Fixed Oracle VM CLI release check 

        New features available in 0.7a:

        • Compatible with Oracle VM 3.3 / 3.4
        • Script is now able to identify Oracle VM Manager release and evaluate features enabled or not
        • New options for backup-type available: FULL, SNAP and OVA (OVA available only with 3.4 OVM Release)
          • FULL => HotClone will create a full vdisk backup on a further repository
          • SNAP => HotClone will create an ocfs2 reference-link snapshot of the vm on the same repository
          • OVA  => HotClone will create a packaged OVA file on a further repository
        • Retention is now applied on different backup-types
        • New definition of backup vm name:
          • $guest-OVA for OVA backup types
          • $guest-SNAP for ocfs2-reflink backup types
          • $guest-FULL for full-backup types
        • Retention continues to be applied also on old backups ( $guest-CLONE )

        The hot-backup obtained by this script is always a crash-consistent backup of the running vm; if the VM owns also physical-disks, the backup will contain only virtual-disks and so, a manual intervention is needed to have it correctly booting/starting.

        Here you can find one high-level picture of the target of this script:

        The idea, here, is to have low-retention backups available on one NFS repository and medium/long retention on a Tape-Library / Further solution (see NDMP); an example could be to have latest 8/15 days (from 8 to 15) on the NFS share and oldest backups on the Tape-Library / NDMP.

        So the retention can be managed between the two solutions (HotCloneVm script and Tape Library/NDMP) where:

        • HotCloneVm.sh will manage the low-retention on the NFS Repository
          • both Incremental and Full approaches are available with "SNAP" and "FULL"
        • Tape Library / NDMP will manage the long-retention on the Tape Library / NDMP solution
          • both Incremental and Full approaches can be managed by Tape Library / NDMP

        Having the low-retention on the NFS will allow, moreover, to have a fast restore point for:

        • Single VM file restore or a list of them
          • Just start the VM, that resides on the NFS repository, with a temporary IP address and get files needed.
        • Entire VM restore
          • Stop the original VM and Start a snapshot and/or Clone/Move the FULL backup from the NFS
          • You can also evaluate to start the vm on the NFS repository to be even faster

        Another option, available only with 3.4 release, is to have backups in OVA format; this option will allow to have backups that can be exported/imported to further Oracle VM Pools; for example you can use OVA exported to have the same VM available on a different Oracle VM Pool (like a clone from Production to Development) or on your laptop/desktop using VirtualBox.

        First of all you need to setup an ssh-key exchange to obtain a self-authenticated system:

        [scoter@ovmm: ~/Documents/OVM_34/HotCloneVm_0.7a]# ./SetupSsh.sh
        #####################################################################################
        You have to specify <guest id> or <guest name>:
        Use SetupSsh.sh <Oracle VM Manager host> <Linux oracle user password> <Oracle VM Manager Password> 
        Example:
        SetupSsh.sh ovm-mgr.oracle.local oracle Welcome1
        ##########################################################################################
        [scoter@ovmm: ~/Documents/OVM_34/HotCloneVm_0.7a]# 

        NB: If you have already configured ssh-key exchange vs OVMCli you don't need to execute "SetupSsh.sh" script.

        To identify syntax to be used, you have only to execute the command without any option:

        [scoter@myhost: ~/]# ./HotCloneVm.sh
        #####################################################################################
         You have to specify <guest id> or <guest name>:
         Use HotCloneVm.sh <Oracle VM Manager password> <Oracle VM Manager host> <guest name> <Oracle VM Server Pool> <target Repository> <Backup Retention> <backup_type>
         <backup_type> options are (no case-sensitive):
                - FULL => HotClone will create a full vdisk backup on a further repository
                - SNAP => HotClone will create an ocfs2 reference-link snapshot of the vm on the same repository
                - OVA  => HotClone will create a packaged OVA file on a further repository - available from 3.4
        Example:
         HotCloneVm.sh Welcome1 ovm-mgr.local vmdb01 myPool repotarget 8d FULL (retention will be 8 days)
         HotCloneVm.sh Welcome1 ovm-mgr.local vmdb01 myPool repotarget d8 SNAP (retention will be 8 days)
         HotCloneVm.sh Welcome1 ovm-mgr.local vmdb01 myPool repotarget 8c OVA  (retention will be 8 copies)
         HotCloneVm.sh Welcome1 ovm-mgr.local vmdb01 myPool repotarget c8 FULL (retention will be 8 copies)
        ##########################################################################################

        As usual, your feedback will be really appreciated. 

        Friday Oct 02, 2015

        Oracle Open World 2015: Oracle Linux, Virtualization and OpenStack Showcase


        Open World 2015 is coming and we are going to attend this important event in San Francisco. Meet our experts on Oracle Linux, Virtualization and OpenStack that can help you out with your questions.
        Over there you'll also have the opportunity to see demos as well as solutions proposed by our partners. 

        Here you can find all the details. Hope to meet you over there!!!

        Simon

        Saturday Sep 12, 2015

        VirtualBox 5.0 Enhancements and Features: Disk Image Encryption


        On July 9th 2015 we released our new VirtualBox 5.0 major release.
        This release introduced many new features like:

        •    Virtual Machine Management
            - Paravirtualization support for Windows and Linux guests
            - More instruction set extensions available to the guest

        •     Device support
            - xHCI Controller to support USB 3 devices

        •     Usability
            - Improved Drag and drop support
            - Disk image encryption
            - VMs started with separate GUI – foreground – / VM – background – processes

        And a further list of GUI enhancements that will be better described in the next articles.

        The new features that I’m going to introduce today is “Disk Image Encryption”.

        As you know, the encryption options is something available also on your Host Operating System and for business environments could be a must-to-have; that said, usually, someone could say:

        “I already have my encryption at a lower level (Host OS), why do I need further encryption for my vms ??”

        Personally I think that today having encryption on your personal or company laptop could not be enough; the era of CDs/DVDs is going to end (maybe it’s already over) but a new era is coming:

        •    Local: USB-Keys, USB-disks and, even, mobile devices like our smartphones
        •    Remote: cloud backup solutions ( free or paid )

        Once we are going to copy or move something ( in our example virtual-machines ) on an external local device or on a cloud backup solution often the destination could not be encrypted; so, while your company spent a bunch of $ to have data encryption, your virtual-machines, once copied on external-devices, could have been accessed and used by everyone.

        Our virtual-machine, created on top of VirtualBox, could contain confidential information, or our next software release, software code or anything else that needs the highest security level.

        So, this is the target of our new feature “Disk Image Encryption”; thanks to this feature you’ll have encrypted virtual-machines and even if you are going to copy/clone or move them on external-devices / web-storage / cloud-backup their built-in encryption will maintain your data secure.

        Note: The “Disk Image Encryption” is shipped as a VirtualBox extension pack, which must be installed separately.

        Starting with VirtualBox 5.0 ( our latest release today is 5.0.4 ), it is possible to encrypt the data stored in hard disk images transparently for the guest. VirtualBox uses the AES algorithm in XTS mode and supports 128 or 256 bit data encryption keys (DEK):




        This operation can be executed also using command-line interface, using following syntax:
        VBoxManage encryptmedium "uuid|filename" --newpassword "file|-" --cipher "cipher id" --newpasswordid "id"

        The DEK is stored encrypted in the medium properties and is decrypted during VM startup by entering a password which was chosen when the image was encrypted:




        This operation can be executed also using command-line interface, using following syntax:
        VBoxManage controlvm "uuid|vmname" addencpassword "id" "password" [--removeonsuspend "yes|no"]

        In some circumstances it might be required to decrypt previously encrypted images and this can be achieved both from GUI and command-line interface:




        This operation can be executed also using command-line interface, using following syntax:

        VBoxManage encryptmedium "uuid|filename" --oldpassword "file|-"


        Final considerations

        Since the DEK is stored as part of the VM configuration file, it is important that it is kept safe. Losing the DEK means that the data stored in the disk images is lost irrecoverably. Having complete and up to date backups of all data related to the VM is the responsibility of the user.
        Here an example of the configuration file of one encrypted virtual-machine:




        This is our first chapter of many, about new features introduced by VirtualBox 5.0. See you to the next feature!
        Let's keep in touch!


        Simon COTER


        About

        Simon Coter (@scoter80) is a Principal Product Manager for Oracle VM and VirtualBox.

        Twitter

        Search

        Categories
        Archives
        « July 2016
        SunMonTueWedThuFriSat
             
        1
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        16
        17
        18
        19
        20
        21
        22
        23
        24
        25
        26
        27
        28
        29
        30
        31
              
        Today