Showing posts with label Windows Server 2008 R2. Show all posts
Showing posts with label Windows Server 2008 R2. Show all posts

Monday, August 19, 2013

How to Update The Provisioning Services (PVS) Agent or Hypervisor Tools The Easy Way

Either you are updating the Provisioning Services (PVS) client on a target device or you are updating the hypervisor tools, there are a few methods to choose from.  One of the quickest and least error prone (in my opinion) methods to perform this is by using the VHD attach method.  This method works with XenServer, Hyper-V, and VMware.  I have also used this method using PVS 5.6 and 6.1.  Instead of reverse imaging, or keeping a master VM to re-image from, all you need is the latest merged VHD.  I say merged because you will need to perform a merge (versions + base) into a single VHD if using PVS 6.1. Below are the steps to perform this in a XenServer or VMware environment.  Hyper-V is almost self-explanatory, as you can boot to the VHD without much effort.

VMware

I have used this method to migrate PVS images from VMware 4.x to 5.x, updating the VMware tools and hardware versions as well as applying PVS agent hotfixes.  This method is a bit more involved than using Hyper-V or XenServer, but it works well.
  1. Merge all versions and the base image into one VHD from within PVS.
  2. Download and install WinImage.  There is a 30 day trial for WinImage, which should be fine to complete this process.
  3. Using WinImage, convert the VHD file to VMDK.
  4. Copy the VMDK file to the VMware datastore.
  5. Create a new VM using the VMDK you just copied.
  6. Log in with the local administrator account (you may have to rejoin the domain).
  7. Uninstall the PVS agent and reboot.
  8. Install any VMware tools updates or VMware hardware version updates.
  9. Install the PVS agent.
  10. At this point you can either copy the VMDK image and use WinImage to convert the image back to VHD, or use the PVS agent wizard.

XenServer


Using XenServer is a bit quicker than using VMware as you don't have to perform any VHD conversions.

  1. Create a NFS share on the PVS server:
    1. Windows 2003:
      1. Using WinSCP, copy the following files from XenServer to the desktop:
        1. /etc/passwd
        2. /etc/group
      2. Install NFS on Windows:
        1. Launch the Add/Remove Windows Components Wizard in the Control Panel
        2. Select the following:
          1. Other Network File and Print Services | Microsoft Services for NFS
          2. Other Network File and Print Services | Microsoft Services for NFS | User name mapping
      3. Configure NFS:
        1. Open Microsoft Services for NFS.
        2. Right-click "User name mapping" and click "Properties".
        3. Select "Use password and group files".
        4. Browse to the passwd file you downloaded to your desktop for the password file.
        5. Browse to the group file you downloaded to your desktop for the group file.
        6. Click "OK".
        7. Right-click "User maps" and click "Create map".
        8. Verify the domain and select an administrator account.
        9. For the Unix user specify "root".
        10. Click "Add".
      4. Create a NFS share:
        1. Create a new directory.
        2. Right-click the new directory and select "NFS Sharing" tab.
        3. Select "Share this folder".
        4. Check "Allow anonymous access".
        5. Click "Permissions".
        6. Check "Allow root access".
        7. Set the "Type of access:" to "Read-Write".
        8. Click "OK".
        9. Click "OK".
    2. Windows 2008:
      1. Install the file role service "Services for Network File System".
      2. Create a NFS share:
        1. Create a directory.
        2. Right-click the directory and select "NFS Sharing" tab.
        3. Enable sharing and specify a name.
        4. Click "Manage NFS Sharing".
        5. Click "Permissions".
        6. Set "Type of access" to "Read-Write"
        7. Check "Allow root access".
        8. Click "OK".
        9. Click "OK".
        10. Click "OK".
  2. Create a new SR in XenServer and point to the NFS share you created earlier.  Remember, the NFS share is case sensitive.
  3. Create a new VM in XenServer with the same specifications as the existing target devices.  Choose the new NFS SR to hold the vDisk for this VM.  Do not start this VM automatically.
  4. Within PVS, set the image you want to update to private mode.
  5. Copy or cut the VHD to the NFS share directory.  You should see another VHD in the NFS share directory with the UUID of that VHD.
  6. Rename the VHD you just copied into the NFS share directory with the same name of the VHD that was created when you created the VM within XenServer.
  7. Boot the VM within XenServer.
  8. Uninstall the PVS agent.
  9. Restart the VM and update any hypervisor tools.
  10. Install the new PVS agent.
  11. Shutdown the VM and cut or copy the VHD back to the PVS store and rename it appropriately back to the original name.
  12. Boot to the image using one of your target devices to make sure all is working and then close the image as you normally do.

Thursday, March 1, 2012

(Updated) Page Hangs at agesso.jsp After Logging in Through Access Gateway on NetScaler 9.3


This is an update to my original post.  I've decided to update this post to include some more troubleshooting tips to help resolve this issue.  I have seen this error a few times and as of now each time was a different problem.  The previous article was posted here.

Step 1: Verify STA / XML servers are responding

  1. Verify the STA URL.  The URL should be in the following format: http[s]://[FQDN of STA server]/scripts/ctxsta.dll
  2. Confirm you can reach the XML service:
    1. Start your favorite telnet client
    2. Open a session to the FQDN of your STA server on the port which your XML service is running
    3. You should receive some sort of response, which verifies the XML service is responding
  3. If steps 1 and 2 are failing, or you are still having issues, check the event log on the STA servers for any issues and check to make sure all your services that are set to automatic are started.
At one customer site, I found an issue with the XML service not responding on one of the servers.  I also found other issues on that server, the SID was not randomized causing authentication issues.  So I performed a Sysprep on that server to randomize the SID and re-add it to the domain.  After the server was back online the XML service was responding correctly.  For more detailed information on how to sysprep a server please see the section Solution 1: How to generalize a computer SID.

Step 2: Check the Web Interface log on the NetScaler

  1. Start your favorite SSH client
  2. Open a session to the NetScaler
  3. Type shell
  4. Type cd /var/wi/tomcat/logs
  5. There will be a bunch of files named localhost.[date].log.  Find the log file with the most recent date and open it.
  6. Scroll down to the bottom of the file to see the most recent entries and look for any errors or issues.
I found an issue here in one instance with the following error message:

..."Event Log ID: 18001 A communication error occurred while attempting to contact the Access Gateway authentication service at https://[fqdn of Access Gateway]/CitrixAuthService/AuthService.asmx.  Check that the authentication service is running.  The message reported by the underlying platform was: ; nested exception is: You have not chosen to trust "GTE Cybertrust Global Root", the issuer of the server's security certificate"...

With the above error, the problem was that the Web Interface call back to Access Gateway isn't working because the Java the certificate wasn't being imported to the java trusted store.  This was verified when I went to the Web Interface in question on the NetScaler with the Access Gateway attached and the option "Trust SSL Certificates" was selected but when you next through the options you get to the end and you get the following error:

"Import SSL certificate failed.  Following command execution failed: ./export_cert.sh"...

So at this point I needed to manually add the certificate as a trusted certificate in the java store.  Please see the section Solution 2: How to manually add a trusted certificate in the java store.

Solution 1: How to generalize a computer SID

The steps below will not delete any data on the computer. But, make sure your data is backed up before proceeding.
  1. Remove the computer from the domain.
  2. Navigate to: c:\Windows\System32\sysprep\sysprep.exe.
  3. The System Preparation Tool will open.
  4. Under System Cleanup Action, select Enter System Out-of-Box Experience (OOBE).
  5. Make sure the Generalize checkbox is selected.
  6. Under Shutdown Options, select Reboot.
  7. The server will then reboot and the SID will be generalized.
  8. Go through the normal system setup steps.
  9. Add the server back to the domain.
Solution 2: How to manually add a trusted certificate in the java store

  1. Open your favorite SSH client and open a session to your NetScaler.
  2. Access the shell by typing: shell and press enter.
  3. Backup your existing java store:
    1. Type: mv /var/wi/java_home/lib/security/cacerts /var/wi/java_home/lib/security/cacerts.bak
    2. Modify the export_sh.sh file:
      1. You can use WinSCP or if you are familiar with a Linux text editor to modify /netscaler/wi/export_cert.sh.
      2. Find line STOREPASS=
      3. Type in a 6 digit keystore password after STOREPASS= (e.g. STOREPASS=abc123)
      4. Save the file.
      5. Copy the file:
        1. cp /netscaler/wi/export_cert.sh /var/wi/
    3. Modify the rc.netscaler file to make these changes persistent across reboots:
      1. You can use WinSCP or if you are familiar with a Linux text editor to modify /netscaler/rc.netscaler.
      2. Enter the following line: cp /var/wi/export_cert.sh /netscaler/wi/export_cert.sh.
    4. Add the certificate to your store:
      1. Please note, the certificate you need is in the X.509 format, not PEM.  So you will need to grab a copy of your certificate in the X.509 format but you do not need to export the private key.
      2. Copy the X.509 certificate to your NetScaler in the following directory: /var/wi/java_home/bin
      3. In the SSH shell session, type: cd /var/wi/java_home/bin.
      4. Type the following command to import the X.509 certificate: ./keytool -import -trustcacerts -file [certificate file name] -alias [certificate file name] -keystore /var/wi/java_home/lib/security/cacerts.
      5. You will be prompted to enter the keystore password which you defined earlier in the export_cert.sh file.
      6. When prompted Trust this certificate? [no] type yes.

This post was written in reference to the following platforms and versions:

  • Citrix Web Interface 5.4
  • Citrix NetScaler 9.x
  • Citrix XenApp 6.5
  • Microsoft Windows 2008 R2

Sources:

Citrix Systems, Inc.. (March 26, 2014). How to Manually Configure Certificate Trust in Web Interface for NetScaler [Article]. Retreived from http://support.citrix.com/article/CTX127615


Sunday, May 31, 2009

Windows Server 2008 R2 New Active Directory Features

Windows Server 2008 put a decent amount of new Active Directory features. But what about Windows Server 2008 R2? This is expected to be released in the 4th quater of 2009. Here are some great new features to expect.



Recycle Bin for Active Directory



Starting with Active Directory, a fear of deleting objects came almost immediate. As the process to recover deleted objects takes a decent amount of downtime. As time went on Symantec put out a Backup Exec Agent for Active Directory that supposedly eased this trouble. But, now Microsoft has created a recycle bin for Active Directory objects. This recycle bin allows recover for deleted users, groups, etc... Attributes are automatically recovered with the object, including linked attributes. Objects by default are stored in the recycle bin for 180 days. The recycle bin retention time can be modified.



There are few requirements for you to get this feature. First, all domain controllers must be Server 2008 R2. Second, you must turn on the recycle bin. To gain access to the recycle bin is done solely through PowerShell. You can use the Get-ADObject cmdlet and pipe the results to the Restore-ADObject cmdlet. You can even empty the recycle by piping the results of querying whats in the recycle bin to the Remove-ADObject cmdlet.

Of course, the Active Directory database size or DIT file size does increase because of this feature. The size increases by 10% - 15% on average.

Managed Service Accounts

Many different programs and services needed to have an associated user account to perform certain tasks. The way these service user accounts were created was just like a regular user. But, now you had to manage these service user accounts and passwords. To do away with this issue Microsoft has come up with managed service accounts.

With managed service accounts (MSA), both the password and service principal name are managed by Active Directory. To create a MSA you use the New-ADServiceAccount cmdlet in PowerShell. You will also have to assign these accounts to a computer object, and you do this with the Add-ADServiceAccount cmdlet. A MSA can only be assigned to one computer object, so you cannot have multiple computers use the same MSA. You assign permissions to the MSA just like you would any other user account.

Since Active Directory manages the password, you don't enter one. This may pose a problem when you are installing a program that requires an account be specified and a password as well. To get around this you can create a temporary user account and then when the service is created, go in and change it to the MSA.

There are a couple limitations as well. First, scheduled tasks to not work with MSA's. Second, MSA's do not work with clustered services.

PowerShell

There are a new set of cmdlets in PowerShell for Active Directory. This is now more consistent with other server roles. You can also navigate Active Directory through familiar commands in PowerShell.

Active Directory Administrative Center

Microsoft has created a new interface. This interface is task oriented and now more consistent between the CLI and GUI. The navigation design is meant to support multiple domains and forests. This is the foundation for future UI enhancements.

Active Directory Best Practices

With Active Directory, there are hundreds of best practices but it changes for each environment. Also, it is sometimes hard to distinguish between best practices and "nice to haves". Also, when analyzing an issue, it can be quite cumbersome. To answer these challanges, Microsoft will be coming out with an Active Directory Best Practices tool. This is to be exptected since more and more of their other product have been getting this tool for some time now. The AD BPA will analyze AD settings that cause most unexpected behavior. The tool will only flag the setting or config, you will have to make the changes yourself.