locked
Hyper V Clone of SQL Server 2008 fails to start MSSQLSERVER

    Dotaz

  • I have attempted to clone a SQL Server 2008 virtual machine in Hyper V. The cloning worked and the VM started just fine. However, the SQL Server will not start.

    The server was joined to a domain and I have reentered credentials for the domain account used as a service account for all SQL Services.

    The error in the System event log is Event 7000, "The SQL Server (MSSQLSERVER) service failed to start due to the following error: The system cannot find the path specified."

    I have verified that all the SQL folder/file structure is in place and at the same location/drives present in the server template VM. I attempted to drop the SQL server name using SQLCMD and the sp_dropserver stored procedure (the intent to then use sp_addserver %computername% in order to add it back withe new computer name) but was told SQLCMD was not a supported command.

    I attempted to run a repair on the installation, and this produced multiple errors regarding lack of all the system databases and multiple files. All of which (including the system DBs) I verified were actually present.

    I am used to using VMWare to make this a practically seemless process using VM Templates (Have created multiple fully functional SQL Server 2008 templates and clones in VMWare), but Hyper V has no such basic capabilities. But, it is what have to work with at this time.

    So...how do I get this process to work in Hyper V?

    18. června 2010 17:32

Odpovědi

Všechny reakce

  • Can you give more details on how did you clone the VM? Did you clone it via SCVMM? If not, was the VM sysprepped during clone operation?

    Thanks,


    Serdar Sutay [MSFT]
    Program Manager, Hyper-V
    This posting is provided "AS IS" with no warranties, and confers no rights.
    18. června 2010 20:30
    Vlastník
  • Hi,

    if I do a P2V of systems with databases on it, I will stop the database-services first. Did you tried it with stopping SQL-services?


    Peter Forster, MVP Virtual Machine, Austria http://www.base-it.at
    19. června 2010 21:18
  • Can you give more details on how did you clone the VM? Did you clone it via SCVMM? If not, was the VM sysprepped during clone operation?

    Thanks,


    Serdar Sutay [MSFT]
    Program Manager, Hyper-V
    This posting is provided "AS IS" with no warranties, and confers no rights.


    Yes, I ran Sysprep on the machine with the shutdown action.

    Then in Hyper V performed an export of the VM to an alternate HD location. Followed this with an import in Hyper V. Gave the system a different name during the initial system startup. The new VM booted fine and everything on it worked except SQL Server.

     

    24. června 2010 11:38
  • Hi Kevin,

    my personal opinion here is, this isn't a Hyper-V specific problem it is more related to SQL server....

    ...couldn't confirm it in the short time now but as far as I'm aware SQL 2008 RTM doesn't "offically" support sysprep mechanism. Sysprep support was added with SQL 2008 R2 ->http://msdn.microsoft.com/en-us/library/ee210664.aspx - Anyway "isn't supported" doesn't mean, that this doesn't work :-) If this is for testing environments, you need to do some additionals steps after sysprepping the OS.

    We do run these additional SQL statements in a automated mannger to update the SQL servername when the sysprepped image starts 1st:

    SET SQL=C:\install\SQL.sql
     ECHO DECLARE @SRVNAME SYSNAME >%SQL%
     ECHO SELECT @SRVNAME = @@SERVERNAME >>%SQL%
     ECHO EXEC SP_DROPSERVER @SRVNAME >>%SQL%
     ECHO EXEC SP_ADDSERVER '%COMPUTERNAME%' >>%SQL%
     OSQL -E -n -w 20 -s -h-1 -i "%SQL%" 
     ::DEL /F "%SQL%"
    

    NO WARRANTY AT ALL THAT THIS WILL WORK IN YOUR ENVIRONMENT + YOU SHOULD CRETATE A FULL BACKUP OF YOUR SYSTEM BEFORE YOU TEST THIS :-)

    Considerations for Installing SQL Server Using SysPrep

    http://msdn.microsoft.com/en-us/library/ee210754.aspx

    Let me know if that works for you....

    Regards

    Ramazan

    24. června 2010 19:29
  • Hi Kevin,

    my personal opinion here is, this isn't a Hyper-V specific problem it is more related to SQL server....

    ...couldn't confirm it in the short time now but as far as I'm aware SQL 2008 RTM doesn't "offically" support sysprep mechanism. Sysprep support was added with SQL 2008 R2 ->http://msdn.microsoft.com/en-us/library/ee210664.aspx - Anyway "isn't supported" doesn't mean, that this doesn't work :-) If this is for testing environments, you need to do some additionals steps after sysprepping the OS.

    We do run these additional SQL statements in a automated mannger to update the SQL servername when the sysprepped image starts 1st:

    SET SQL=C:\install\SQL.sql
    
     ECHO DECLARE @SRVNAME SYSNAME >%SQL%
    
     ECHO SELECT @SRVNAME = @@SERVERNAME >>%SQL%
    
     ECHO EXEC SP_DROPSERVER @SRVNAME >>%SQL%
    
     ECHO EXEC SP_ADDSERVER '%COMPUTERNAME%' >>%SQL%
    
     OSQL -E -n -w 20 -s -h-1 -i "%SQL%" 
    
     ::DEL /F "%SQL%"
    
    

    NO WARRANTY AT ALL THAT THIS WILL WORK IN YOUR ENVIRONMENT + YOU SHOULD CRETATE A FULL BACKUP OF YOUR SYSTEM BEFORE YOU TEST THIS :-)

    Considerations for Installing SQL Server Using SysPrep

    http://msdn.microsoft.com/en-us/library/ee210754.aspx

    Let me know if that works for you....

    Regards

    Ramazan


    It is SQL Server 2008 R2. I tried the SQL statements you mentioned, but the statements failed. The MSSQLSERVER service never starts.

    This is so easy in VMWare and have done it dozens of times. Why is it so hard to clone in Hyper V?

    24. června 2010 21:40
  • Hi,

     

    As RCan mentioned, it’s not a Hyper-V specific problem, it is recommend you to get further support in the corresponding community so that you can get the most qualified pool of respondents. Thanks for your understanding.

     

    For your convenience, I have list the related link as followed.

     

    SQL Server

    http://social.technet.microsoft.com/Forums/en-US/category/sqlserver

     

     

    Best Regards,

    Vincent Hu

     

    • Označen jako odpověď Kevin Hughes 25. června 2010 12:08
    25. června 2010 7:16
    Moderátor
  • Thank you for the predictable response.

    I have moved my plea for assistance to the suggested forum.

    25. června 2010 12:08