piątek, 24 lutego 2012

ESXi 5.0 slow run blade to RAW mapped

To mark the MSCS LUNs as permanently reserved on an already upgraded ESXi 5.0 host, run the same esxcli command as above and all subsequent rescans/boots will be at normal speed.

1. Determine which RDM LUNs are part of an MSCS cluster.
2. From the vSphere Client, select a virtual machine that has a mapping to the MSCS cluster RDM devices.
3. Edit your Virtual Machine settings and navigate to your Mapped RAW LUNs.
4. Select Manage Paths to display the device properties of the Mapped RAW LUN and the device identifier (that is, the naa ID).
5. Take note of the naa ID, which is a globally unique identifier for your shared device.
6. Use the esxcli command to mark the device as perennially reserved:
Najważniejsze
esxcli storage core device setconfig -d ==naa.id== --perennially-reserved=true

7. To verify that the device is perennially reserved, run this command:

esxcli storage core device list -d ==naa.id==

In the output of the esxcli command, search for the entry Is Perennially Reserved: true. This shows that the device is marked as perennially reserved.

8. Repeat the procedure for each Mapped RAW LUN that is participating in the MSCS cluster.

Note: The configuration is permanently stored with the ESXi host and persists across reboots. To remove the perennially reserved flag, run this command:

środa, 1 lutego 2012

PowerShell - hurtowe uprawnienia

W cmd na prawach admin wykonaj Powershell Set-ExecutionPolicy Unrestricted

c:\skrypt\permission.ps1

$dirPath = "C:\test\"
$dirs = Get-ChildItem $dirPath | where {$_.PsIsContainer} | Select Name, FullName
foreach($item in $dirs)
{
$acl = Get-Acl $item.FullName
$permission = ("DOMENA\{0}" -f $item.Name),"FullControl","Allow"
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
$acl.SetAccessRule($accessRule)
$acl | Set-Acl $item.FullName
}