none
Linux VM deployment using template hangs at 99%

    Question

  • Hi all,

    I am having a custom Linux VM template. I have two disk, one IDE and One SCSI disk. I have configured everything on the template.

    When I deploy a virtual machine using the template using SCVMM 2008, the virtual machine is created fine. But it is started automatically when the progress is at 99%. Even after a long wait, the create virtual machine process is still at 99% at "customize virtual machine" task.

    Is this a problem with SCVMM?

    Any help is appreciated.

    Thanks,

    Saleem

    • Moved by BrianEhMVP Thursday, June 05, 2014 4:19 PM
    Tuesday, April 29, 2014 1:39 PM

All replies


    • Edited by A Saleem Tuesday, April 29, 2014 1:54 PM
    • Proposed as answer by Pavel Gladkikh Thursday, October 15, 2015 9:29 AM
    • Unproposed as answer by Pavel Gladkikh Thursday, October 15, 2015 9:29 AM
    Tuesday, April 29, 2014 1:42 PM
  • SCVMM is trying to customize the OS in the VM and it cannot.

    Is the setting on the VM Template (the OS disk) set to Linux so that SCVMM knows not to treat this like a Windows VM (which is the default template deployment behavior)?

    And, if I recall properly, SCVMM 2008 does not have Linux support for Templates.  You can deploy using a VHD but not from a template.  Since the SCVMM assumption is that a template is generalized with sysprep and an OS customization must be applied.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    Tuesday, April 29, 2014 4:08 PM
  • Hi Brian,

    Yes. The setting on the VM template is Linux. Verified in the VM properties also.

    <ovf:Info>Guest operating system</ovf:Info>
    <!--Other Linux (64 bit)-->

    Regarding SCVMM, I use SCVMM 2012  version. It entered SCVMM 2008 by mistake.

    Thanks,

    Saleem

    Tuesday, May 06, 2014 9:50 AM
  • Hi Brian,

    Waiting for an answer..

    Thanks,

    Saleem

    Monday, May 12, 2014 9:54 AM
  • Do you meet all of the Linux specific requirements mentioned here: http://technet.microsoft.com/en-us/library/hh427282.aspx

    and here: http://technet.microsoft.com/en-us/library/jj860438.aspx


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    Tuesday, May 13, 2014 2:57 AM
  • I didn't install the Linux Guest agent in my Linux. I will install it and test. Could be please explain the purpose of that ?

    BTW, can I add the guest agent file to my custom linux so that it will be installed on bootup?

    Thanks,

    Saleem

    Wednesday, May 14, 2014 9:35 AM
  • In the VMM model a 'template' is a source virtual disk (with OS) plus settings (OS and Application) that is deployed into a unique instance.

    In the case of Windows - VMM mounts the VHD, injects an agent, installer, dismounts, presents an unattend.xml using a virtual floppy, processes using the capabilities of mini-setup.

    In the case of Linux there is no mounting of the VHD since Windows does not have providers for Linux file systems - so the agent method is still used, by presenting a virtual floppy that the agent reads a file from and applies.

    VMM did not support Linux as a 'template' until this agent appeared.

    This is very different than what other virtual machine platforms call a 'template'

    I cannot answer the question regarding the install.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    Wednesday, May 14, 2014 1:12 PM
  • Thanks Brian.

    I successfully installed the scvmm guest agent in my linux VM.

    bash-3.2# ./install scvmmguestagent.1.0.0.544.x64.tar
    05/14/14 13:32:25 UTC   Installing SCVMM Guest Agent to /opt/microsoft/scvmmguestagent
     Adding system startup for /etc/init.d/scvmmguestagent.
    05/14/14 13:32:25 UTC   Successfully installed SCVMM Guest Agent
    bash-3.2#

    Do I need to start the service?

    If I start the guest agent service, my VM reboots in few seconds.

    Am I doing something wrong ?

    Thanks,

    Saleem

    Wednesday, May 14, 2014 2:08 PM
  • The agent needs to be installed in the base virtual disk that is stored in the library that the template is using.

    You can't just add the agent after deployment, it needs to be in the OS installed into the virtual disk (that is stored in the Library) at the time the template is deployed.

    Have it there, deploy a new VM from that template, then report back.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    Wednesday, May 14, 2014 3:08 PM
  • Hi Brian,

    I have added the SCVMM guest agent in the OS disk.

    But still getting the error after deployment of my Linux at 99%.

    Hope it would be useful, if I post the error,

    Error (609)
    Virtual Machine Manager cannot detect a heartbeat from the specified virtual machine. Either the virtual machine is not running or Virtual Machine Additions is not installed.

    Recommended Action
    Verify the status of the virtual machine by connecting to it using Virtual Machine Remote Client (VMRC), and then try the operation again.

    This looks like SCVMM is unable to receive a heartbeat from the LIS in the VM. But LIS is installed and running in my VM.

    Thanks,

    Saleem

    Thursday, June 05, 2014 2:18 PM
  • Since this is now a heartbeat issue - I am going to forward your thread to the Linux IC forum.  If this ends up being an SCVMM issue again after that, just have them send this thread back here.

    But, I am guessing that the ICs are not totally happy in your VM.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    Thursday, June 05, 2014 4:19 PM
  • Was this ever resolved...this thread just end and I am having the same problem.
    Sunday, June 08, 2014 7:08 PM
  • But, I am guessing that the ICs are not totally happy in your VM.

    Hi BrianEh,

    Is this thread moved ?

    One more update is,

    In the SCVMM template properties, I can see the VM Guest Services as Not Detected. But, the VM properties shows the Guest Services as Detected. So, it looks like, the SCVMM is not detecting the Integration Services from my VM.

    ~ Saleem


    Tuesday, June 10, 2014 12:39 PM
  • Hi all,

    Any updates on this post ?

    Thanks,

    Saleem

    Thursday, June 26, 2014 3:35 PM
  • Hi, 

    I had the same issue. I created a new Linux Template with OS settings as [None - no customization required]. The Linux VM was deployed successfully.

    Although I am interestedin knowing as to why the VMM is unable to detect the Virtual Machine Guest Servies on the Linux VHD.

    Thanks,

    Arpit Trivedi

    Tuesday, July 15, 2014 1:33 PM
  • The customization is applied (or attempted) long before vmm could detect the guest agent.

    Also, vmm owes the OS setting of the vhd to determine which guest agent to attempt to inject.

    In the case of Linux, the guest agent cannot be injected as it is with windows during mini setup. But, it is still presented to the vm during the initial boot.

    Vmm really lacked Linux support prior to 2012 r2, and it still is not where it could be.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

    • Proposed as answer by sara04 Thursday, July 17, 2014 5:00 AM
    • Unproposed as answer by sara04 Thursday, July 17, 2014 5:01 AM
    Tuesday, July 15, 2014 1:37 PM
  • For deloying machne in scvmm2012 R2, we need to have two things:

    1.Linux integration services

    2.Vmm agent

    For more details plz follow the below link.

    It works for me for RHEL 6.5

    http://technet.microsoft.com/en-us/library/jj860438.aspx


    Thursday, July 17, 2014 5:05 AM
  • If anyone is still having similar issue, try Debian 8.0. It has LIS built-in, you just need to install VMM agent for Linux. I blogged about this here:

    http://www.ladislavb.com/?p=79

     
    Monday, May 25, 2015 10:12 PM
  • ~~

    If anyone is still having similar issue, try Debian 8.0. It has LIS built-in, you just need to install VMM agent for Linux. I blogged about this here:

    http://www.ladislavb.com/?p=79

    ~~

     Creating Generic Linux VMM Template

    ==

    Installing VMM agent for Linux:

    Syspreping Linux VM is possible through VMM agent for Linux and here is how you can install it. Connect to your Debian VM (for example with WinSCP) and copy all files from c:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\agents\Linux (located on VMM server) to TMP directory via SFTP protocol.

    Login to Debian VM as root,  go to TMP folder and run following commands:

    chmod +x install
    ./install scvmmguestagent.1.0.0.544.x64.tar

    ==

     Thanks!

    Very interessant

    ( IMHO, this file 

    debian-8.0.0-amd64-netinst.iso.tor . . .

     have small size :-)

     Look like best choice

    debian-8.0.0-amd64-netinst.iso

    )

    Tuesday, May 26, 2015 10:30 AM
  • Dont use spaces in names of virtual hard drives, templates and VMs and customization task will be completed.

    Have a nice day!

    Yuri Trukhin, cloud computing expert | InfoboxCloud

    Saturday, February 13, 2016 1:46 AM
  • Hi!

    I have tried to install VMM agent and LIS to different Linux distros (CentOS, Ubuntu, Debian), but I'm still unsuccessful with with all that. VMM shows that VM Additions are not installed.

    I have followed these two posts:

    http://www.ladislavb.com/?p=79#comment-630

    http://blogs.catapultsystems.com/mdowst/archive/2013/11/03/creating-a-linux-vm-template-in-vmm-2012-r2-part-1-create-vm/

    But I was still unsuccessful.

    May be there is somebody who has been able to get Linux Templates work? My intention is to use these templates with Azure Pack.

    Thanks in Advance!

    Regards

    Andres

    Wednesday, February 24, 2016 7:15 PM
  • Hi Andres,

    I am currently trying to achieve the same thing using windows azure pack, I have managed to get the Centos & Redhat templates working by just loading the VMM Agent onto the server, but like you I cannot get Debian 8.3 or ubuntu server 15.10 working.  Same issue with the customisation.  I have copied my current procedure below, which install LIS and the VMM Agent (VM Additions).  Have you managed to actually get this working yet?

    I also found a post that seems to state the IPAddress and MAC address have to set as Static not Dynamic in the template configuration.  With Ubuntu I was also using the OEM Preperation options to try and roll the installation back as if sysprep has been run (Yes I am a windows engineer, my Linux skills are not the best)

    I have not tried to configure this using GRIT again yet, as that was failing with the same errors.

    My current ubuntu preperation procedure:-

    Memory Requirements 1536MB

     

     

    Boot to the Ubuntu setup Disk

     

    Select English as the language


     

     

    At the install screen hit F4 this will bring up a little menu make sure the OEM Install is selected


     

    Then install the Ubuntu Server filling in all the options, these will be wiped out when the OEM-Preperatin is run, it is a good idea to setup an IP Address that has access to the internet so that the applications can be downloaded, we will also be updating the template with security patches.

     

    The option to load updates Manually was selected as this may not be wanted by the customer.

     

    Once the installation has finished it will report that you should login as 'oem'  and that the sudo user will also use the same password.  Also run the 'oem-config-prepare' option to roll the system back and ask the setup questions again.   Hit continue.


     

    The system will request the installation CD should be removed, remove it and continue.


     

    When the system reboot, login with the 'oem' User

     

    Type Sudo -i this will elevate the user to run all commands as root.


     

    Update the system by typing 'apt-get update'

    This will update the system with the latest Security Patches


     

    Type 'apt-get dist-upgrade' this will update the ubuntu software update servers / application download lists.

     

     

    Install the VMM Tools, without the tools the system cannot communicate with VMM properly and a Template cannot be created.

     

    Applies To: System Center 2012 SP1 - Virtual Machine Manager, System Center 2012 R2 Virtual Machine Manager

    Before you can use Virtual Machine Manager (VMM) to manage a virtual machine with Linux as the guest operating system, you must install the VMM agent for Linux on that virtual machine. Use the following procedure to perform that task.

    To install the VMM agent for Linux on a virtual machine

    1. On the VMM management server, open a command prompt session, with administrative rights.
    2. Go to the ‘c:\Program Files\Microsoft System Center 2012\Virtual Machine Manager\agents\Linux’ folder.
    1. Copy all the agent installation files from that folder to a new folder on the virtual machine, and then, on the virtual machine on which Linux is running as a guest operating system, open the new folder.

    I Created an ISO of the Files and copied it to the VMM Library, the version of the VMM agent should be checked and updated in the template as Required.


    1. Mount the CD Drive
      1. Find the name of the CD/DVD Drive type "dmesg | grep sr", we can see blow that this system's ROM drive is SR0

    Machine generated alternative text: (rootBloca lhost

    1. Create a directory to mount the DVD Drive too "mkdir /tmp/vmm"
    1. Mount the ISO "mount -r /dev/sr0 /tmp/vmm" (Ubuntu is more secure by default and the command needs to be run through sudo)
    1. Change directory to the mounted CD Drive "cd /tmp/vmm"
    1. Run either of the following commands, as appropriate: (Again using Ubuntu the sudo command has to be used.
      ./install scvmmguestagent.1.0.0.544.x64.tar
      ./install scvmmguestagent.1.0.0.544.x86.tar


     

    Install the VMM Integration Services

    Please use the steps below for Linux distributions that ship with LIS drivers and services already installed. 

    1. The first step is to edit the "modules" file located in /etc/initramfs-tools using this command: 
      sudo vi /etc/initramfs-tools/modules
    2. In vi Editor, navigate to the last line in the file and use the insert ( I ) command to append and enter the following lines: 
      hv_vmbus
      hv_storvsc
      hv_blkvsc
      hv_netvsc
    3. Save the file by hitting the Esc key and then issuing the ": x" command
    4. Next, run the following commands to re-initialize the “modules” file: 
      sudo update-initramfs –u
    5. Finally, reboot the virtual machine by executing the below command in Shell: 
      sudo shutdown now

    Once the guest virtual machine is rebooted, the LIS drivers and services will be registered in the system.

     

    Remove the CD-ROM from the Virtual Machine, while the server is switched off.

     

    Power on the VM, login again using the 'oem' user

     

    Type 'oem-config-prepare'  this will roll the installation back, removing all configuration, and run the setup wizard again when the customer switches the vm on.


    Shutdown the system 'shutdown now'

    This prepares the disk as if the Linux equivalent of sysprep has been run, I have then been copying it to the VMM library, and trying to create a template from it.
    But I am getting the same errors as everyone else on this page, Heart beat cannot be found and the VM Additions are showing as 'NOT DETECTED'

    Phil

    • Edited by Phil Clark Thursday, May 05, 2016 12:55 PM
    Thursday, May 05, 2016 12:38 PM
  • hello,

    anything new about ubuntu ?
    14.04 is  working, but 16.04 still not.

    thanks

    Tuesday, March 14, 2017 2:40 PM
  • Hey Everyone, 

    I was able to sort the problem out on my own for Debian 8.7.1 running Virtual Machine Manager 2016. Hopefully this will be able to help others.

    When I SSH'd into the VM I noticed the scvmm guest agent was not properly finishing. One of the last commands it ran was /opt/microsoft/scvmmguestagent/bin/cfgpre so I decided to manually run this command. I was greeted with this error message

    2017-04-17T 4:06:36Z    Info    cfgpre: Creating dhclient enter hooks to disable resolv.conf overwrites in: /etc/dhcp3/dhclient-enter-hooks.d/nodnsupdate
    /opt/microsoft/scvmmguestagent/bin/cfgpre: line 32: /etc/dhcp3/dhclient-enter-hooks.d/nodnsupdate: No such file or directory
    chmod: cannot access ‘/etc/dhcp3/dhclient-enter-hooks.d/nodnsupdate’: No such file or directory

    On this distribution of linux the folder /etc/dhcp3/ does not exist, its /etc/dhcp/.

    I edited the script to remove the 3 and restarted the service.

    > /etc/init.d/scvmmguestservice start

    After about 15 seconds I was disconnected from my SSH session as the computer rebooted, after the reboot SCVMM acknowledged that the customization was finished and it continued like expected.

    For a permanent fix I went into scvmmguestagent.1.0.2.1075.x64.tar and edited the /bin/cfgpre file. I made the above noted changes of removing the 3 from line 22. I reinstalled SCVMM Guest Agent onto my VM with the change and remade the template and it worked fine.

    Hope this helps!

    • Proposed as answer by nickmcski Monday, April 17, 2017 4:42 AM
    Monday, April 17, 2017 4:41 AM
  • Thanks nickmcski, that helped.
    Tuesday, December 12, 2017 5:25 AM