title: Copy Azure OSDisks V DataDisks and powershell set Lun at 0
body: <p>I have a couple of questions</p>
  <p>I'm copying some OS disks and some data disks, and I'm using the same process for both, which is create snapshot and then creating disks from the snapshots. I've read a bit online where there's two processes for what appears to be the same task. Is there any difference between the OS Disk and Data Disk when you take a snapshot and create a disk from the snapshot?</p>
  <p>Also I'm trying to attach the aforementioned data disks and the LUN number always starts at 1, would anyone know how I can get it to start at 0. The code I have is</p>
  <pre><code>$dataDisks = Get-AzDisk | ? {$_.name -like &quot;*$ddisk*&quot;} 
  $lun = 0
  
  foreach ($disk in $dataDisks){
  
  $lun += 1
  
  $vm = Add-AzVMDataDisk -CreateOption Attach -VM $vm -Lun $lun -ManagedDiskId $disk.Id
  Update-AzVM -VM $vm -ResourceGroupName $VMRG -Verbose
  
  }
  </code></pre>
  <p>Thanks in advance and apologies if this seems like a lot of questions in one post :)</p>