Paul McCran's

Portfolio
Here are three useful powershell commands for helping to diagnose disconnection issues.  Insert the computer name after "-ComputerName".  Run each section separate.

The trace file will grow to 1GB and then repeat until stopped.

Once you have stopped the trace, copy the ETL file to a share and open the file with Microsoft Message Analyser.  Save and export the file in to .cap format and open with Wireshark.

I have been working on a script that allows you to add the computer names to a text file and will create a trace of each of those computers.  It also allows you to add a username and have the script query a Delivery controller for the associated Citrix machine name and then run a trace.  I'll post that version when complete.


  #START THE TRACE
 
   function Disable-ExecutionPolicy {($ctx = $executioncontext.gettype().getfield("_context","nonpublic,instance").getvalue( $executioncontext)).gettype().getfield("_authorizationManager","nonpublic,instance").setvalue($ctx, (new-object System.Management.Automation.AuthorizationManager "Microsoft.PowerShell"))}  Disable-ExecutionPolicy  .runme.ps1
  
   Invoke-Command -ComputerName   {  
            powershell -command{
            $test=test-path C:\NetworkTrace
            if ($test=test-path C:\NetworkTrace) {
            Remove-Item C:\NetworkTrace -Recurse -Force -EA SilentlyContinue -Verbose
            new-item c:\NetworkTrace -itemtype directory
            netsh trace start persistent=yes capture=yes report=yes maxSize=1024 fileMode=circular overwrite=yes  tracefile=c:\NetworkTrace\nettrace-boot.etl
          }
            else {
           new-item c:\NetworkTrace -itemtype directory
           netsh trace start persistent=yes capture=yes report=yes maxSize=1024 fileMode=circular overwrite=yes  tracefile=c:\NetworkTrace\nettrace-boot.etl
           }                  
                               }                         
         }

#STOP THE TRACE
            Invoke-Command -ComputerName {  
            powershell -command{
            $test=test-path C:\NetworkTrace
            if ($test=test-path C:\NetworkTrace) {
            netsh trace stop
           #new-item c:\NetworkTrace -itemtype directory
            #netsh trace start persistent=yes capture=yes report=yes persistent=Yes maxSize=1024 MB fileMode=circular overwrite=yes  tracefile=c:\NetworkTrace\nettrace-boot.etl
          }}}


#REMOVE THE TRACE
            Invoke-Command -ComputerName  {  
            powershell -command{
            $test=test-path C:\NetworkTrace
            if ($test=test-path C:\NetworkTrace) {
            Remove-Item C:\NetworkTrace -Recurse -Force -EA SilentlyContinue -Verbose
            #new-item c:\NetworkTrace -itemtype directory
            #netsh trace start persistent=yes capture=yes report=yes persistent=Yes maxSize=1024 MB fileMode=circular overwrite=yes  tracefile=c:\NetworkTrace\nettrace-boot.etl
          }}}

MIGRATE A VM FROM XENSERVER to NUTANIX ACROPOLIS

1.      Create a Container called “XEN” on the Nutanix Appliance Prism console

2.      In the Prism menu, select the “Settings” cog icon on top right side of menu and select “Filesystem Whitelists”

3.      Add the XenServer Management IP and subnet eg (x.x.x.x/x.x.x.0). I added the storage IP and subnet also but this may not be required.

4.      On the XenServer that you are migrating from, add a new SR (NFS) and point it to the nutanix / Xen container that you created:

5.      Shut down the VM to be migrated in XenCenter:

6.      Right Click VM after shut down. Export and run through wizard to export to storage on the XenServer Console host

7.      Ok through XenServer migration prompts until “Configure networkin2g options for the transfer VM” window and select “Management Bond” in the drop down “Network” settings.  Choose auto allocate IP or specific a static IP to be used.

8.      Untick Verify Export on Completion

9.      In XenServer Select  “View” then select “Hidden Objects”.  Check the Event Tab log to make sure that the Transfer VM has been created.  Go the console of the Transfer VM and make sure that the VM has picked up a DHCP address so that it can export the VM.

10.   In XenServer, click on “Notifications” and “Events” log.  Click on the Down arrow next to the export VM event and make sure that the status is set to “transferring virtual disk”

11.   Wait until this job is completed.  This can take a few hours.

12.   Detach the virtual disk for the migrated VM in the XenServer console.  You will see the warning “Detaching this virtual disk will remove the association between it and the VM while preserving the disk and its data.  Would you like to continue?”

13.   Go to the SR node in XenServer where the disk is located and select the disk that you detached from the VM.  Right Click and “Move” the Disk to the Nutanix SR that you mounted earlier

14.   Check the XenServer Events tab and wait until the move has completed.  This can take a couple of hours depending on the size of VM.

15.   Once completed, mark the VM in XenServer as “Do not switch on”

16.   Use WinSCP to connect to a CVM  IP and username password

17.   Or username admin and configured password

18.   Double click on the XEN container and copy the file name and container name into the command eg:

19.   image.create VMDRIVE source_url=nfs://127.0.0.1/XEN/51037c42-6da5-cb48-964b-6c226b9ae643/de7bc643-5e97-46b3-bded-a4bfee2ba5a0.vhd container=XEN image_type=kDiskImage wait=true

20.   Putty to admin console

21.   Logon with appropriate username and password

22.   Logon and run:   Acli

23.   Copy and paste the above command and wait and hour or so until the conversion has completed:

24.   This operation will remain at “Pending” status until complete.  Do not try to run the command again or kill the process.  It is not possible to kill the task.

25.   You will also notice an image creation process queued in the Prism Console

 
Next PostNewer Posts Previous PostOlder Posts Home