pacampos's profilePcamposs BlogsPhotosBlogLists Tools Help

Blog


    September 07

    Hyper-v Backup Single Virtual Machine Respaldar una sola máquina

    Hola a todos

    Hoy voy a mostrar como respaldar una sola maquina virtual en caliente y no todo el volumen como lo hace Windows Server Backup, para esto utilizaremos el programa Diskshadow para generar un “snapshot” del Volumen donde residen nuestras maquinas virtuales, para después copiarlas a nuestro file server mediante el utilitario robocopy

    Primero que todo tenemos que ver si nuestro Hyper-V host tiene bien configurado el Volumen Shadow Copy Service, si no así instalar el siguiente parche

    Install this update to resolve an issue in which the Hyper-V Volume Shadow Copy Service (VSS) does not back up virtual machines properly

    Ejecutamos en una consola con privilegios elevados

    vssadmin list writers

    deberíamos encontrar algo así

    Nombre de editor: 'Microsoft Hyper-V VSS Writer'
       Id. de editor: {66841cd4-6ded-4f4b-8f17-fd23f8ddc3de}
       Id. de instancia de editor: {0e0b1c16-02f9-45c5-b51d-1d711c5e88ea}
       Estado: [5] Esperando finalización
       Último error: Sin errores

    image

    En mi caso de ejemplo las maquinas las tengo el el volumen D:\maquinas y expondré la unidad Q: como unidad de paso, el alias del volumen D: será MaquinasVirtuales
    La maquina a respaldar se llama “Win 7 reload”

    Ahora el archivo de texto que se pasa como parámetro al DiskShadow

    diskshadow -s D:\RespaldaHypervDiskshadow.txt

    --------------------------------------------RespaldaHypervDiskshadow.txt--------------------------------------------------
    unexpose Q:
    Delete Shadows all
    set context persistent
    set verbose on
    add volume D: alias MaquinasVirtuales
    create
    Expose %MaquinasVirtuales% Q:
    exec D:\HypervBK.bat
    Delete Shadows all
    unexpose Q:
    Exit

    ----------------------------------------------------------------------------------------------------------------------------------

    Después de exponer la unidad Q: extraeré las maquinas virtuales con el comando robocopy
    ----------------------------------------------HypervBK.bat----------------------------------------------------------------
    robocopy "Q:\maquinas\Win 7 reload" \\MiServidordeArchivos\RespaldosVM\Respaldo7Reload  /E
    verify >nul
    -----------------------------------------------------------------------------------------------------------------------------

    Después podemos generara una tarea programada del comando diskshadow con el parámetro -s D:\RespaldaHypervDiskshadow.txt a la hora que queramos

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://pcamposs.spaces.live.com/blog/cns!7AB747DA209029CF!977.trak
    Weblogs that reference this entry
    • None