3

I am trying to create a TeamCity build agent that can be scaled as needed. I've created a VM, and configured it accordingly. Because we have a lot of projects, I have attached a DATA disk, and have installed the build agent to point to that. Based on other posts, I've mapped the DATA disk to F:. Once completed, I've created an image which I plan to use for all other VM creation of agent. The issue is, when I do perform a creation, it's not maintaining the drive mapping of the DATA disk, so it's now E:. When the agent service tries to start, it's looking for F:. Even if I install the agent on C:\, I want the checkout directory to be on the DATA disk as we'll have a lot of files being checked out (hundreds of GB's). Can't seem to find how this will work from an Azure Powershell perspective.

mickyjtwin
  • 4,960
  • 13
  • 58
  • 77

1 Answers1

2

This is a blog post showing a process for how to make a drive letter change persistent in Azure. http://blogs.msdn.com/b/scicoria/archive/2012/01/19/making-windows-azure-drive-letter-persistent.aspx

Basically, you need to implement a startup task that checks to see which drive letter was assigned - if incorrect, reassigns the correct drive letter.

There is also a sample PowerShell script to assign drive letters. Without all the error checking, it looks like:

Function Set-VolumeDriveLetter ($oldvolume, $newvolume) {
    $driveletter = Get-WmiObject win32_volume -filter "DriveLetter = '$oldvolume'"
    $driveletter.DriveLetter = $newvolume
    $driveletter.Put() | Out-Null
    }
Set-VolumeDriveLetter -oldvolume "R:" -newvolume "E:"

Details here: http://sebmatthews.net/2013/03/change-drive-letters-of-volumes-on-windows-server-using-powershell/ Let me know if this helps and if either method will work for you.

Amanda Lange
  • 733
  • 3
  • 10