Saturday, February 6, 2016

Renaming a virtual machine and its files in VMware ESXi and ESX (KB1029513)

Purpose

This article provides information on how to rename a virtual machine and its files via SSH, System Management Interface, or directly at its console.
Renaming a virtual machine using the vSphere Client only changes the display name, not the corresponding files on the datastore. It may be useful to also rename the virtual machine's files to maintain consistency.

Resolution

Note: Storage/Cold Storage vMotion or using the console renames only the folder names and not the files in ESXi 5.0. This behavior was changed to support Storage DRS on ESXi 5.0. For more information, see vSphere 5 Storage vMotion does not rename virtual machine files on completing migration (2008877).
A virtual machine's files may be renamed during a disk migration operation, such as Cold Storage Migration, or by manually renaming them in-place from the ESXi/ESX console. Select your preferred method.

Alternatively, a virtual machine could be cloned to a new virtual machine using the Clone method in vCenter Server or using vCenter Converter, and deleting the old virtual machine.
Renaming virtual machine files using Storage vMotion
A virtual machine's files can be renamed on the fly during a Storage vMotion initiated from the vSphere Client. The renaming occurs with no downtime.
To rename the files on ESXi/ESX 4.x and 3.5 hosts:
  1. Log in to the VMware vSphere Client.
  2. Locate the virtual machine in your host inventory.
  3. Right-click the virtual machine and click Rename.
  4. Change the virtual machine name as required.
  5. Begin a Storage vMotion or an offline Storage Migration of the virtual machine. For more information, see:
  6. After the migration completes, the virtual machine files match the virtual machine name configured in step 4.
    Note: The Storage vMotion only changes the names of the virtual machine files when the destination datastore is different from the original.
Note: If a virtual machine directory already exists on the datastore with the same name, then the target virtual machine is placed in a new directory with _1 appended.
Renaming virtual machine files using Cold Storage Migration
The files of virtual machine can be renamed on the fly when a Cold Migration is initiated from the vSphere Client in ESX/ESXi 4.x. In ESXi 5.x, only the virtual machine's folder is renamed.
To rename the files:
  1. Log into the VMware vSphere Client.
  2. Locate the virtual machine in your host inventory.
  3. Right-click the virtual machine and click Rename.
  4. Change the virtual machine name as required.
  5. Perform Cold migration to a new datastore of the virtual machine.

    For more information, see:
  6. After the migration completes, the virtual machine files match the virtual machine name configured in Step 4.
Note: If a virtual machine directory already exists on the datastore with the same name, then the target virtual machine is placed in a new directory with _1 appended.
Renaming virtual machine files in-place using the console
Warning: Before proceeding, ensure that:
  • The virtual machine has a current backup, and that it has been powered down.
  • The virtual machine does not have snapshots or virtual disks shared with other virtual machines.
To manually rename the virtual machine's files:

  1. Log into the VMware vSphere Client.
  2. Locate the virtual machine in your host inventory.
  3. Power down the virtual machine.
  4. Right-click on the virtual machine and click Remove from inventory.
  5. Open a console to the ESXi/ESX host. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
  6. Navigate to the directory containing the virtual machine. For example:

    # cd /vmfs/volumes/DatastoreName/originalname
  7. Rename the virtual disk (VMDK) files using the vmkfstools -E command. For more information, see Renaming a virtual machine disk (VMDK) via the vSphere Management Assistant (vMA) or vSphere CLI (vCLI) (1002491).

    # vmkfstools -E "originalname.vmdk" "newname.vmdk"

    Notes:
    • In some cases, it may be required to clone (copy) a virtual disk. To clone a virtual disk to a new virtual disk, run this command:

      # vmkfstools -i "originalname.vmdk" "newname.vmdk"

      This leaves the original virtual disk untouched. You need enough space available to clone the virtual disk in the destination directory. In the case of the command above, the new virtual disk is created in the current directory but a different directory can be specified.
    • You need not rename the originalname-flat.vmdk file after running the vmkfstools command. The vmkfstools command renames both VMDK files and updates the reference within the descriptor.
    • Do not use the cp or mv commands to rename virtual disk files. Instead, use VMware utilities such as vmkfstools.
  8. Copy the virtual machine configuration file (.vmx) using the command:

    # cp "originalname.vmx" "newname.vmx"
  9. Open the file new virtual machine configuration (for example, newname.vmx) in a text editor. For more information, see Editing configuration files in VMware ESXi and ESX (1017022).

    For example:

    # vi "newname.vmx"
  10. Within the configuration file, modify all old instances of the virtual machine's file names to the new file names. At a minimum, modify these values (more may exist):

    nvram = " newname.nvram"
    displayName = " newname "
    extendedConfigFile = " newname .vmxf"
    scsi0:0.fileName = " newname .vmdk"
    [...]
    migrate.hostlog = "./ newname -UUID.hlog"

    Repeat this process for each virtual machine disk. For example:

    scsi0:1.fileName = " newname _1.vmdk"
    scsi0:2.fileName = " newname _2.vmdk"

    Correct the VMkernel swap file reference. For example:

    sched.swap.derivedName = "/vmfs/volumes/DatastoreUUID/ newname/ newname-UUID.vswp

    Note: Be sure to rename both the .vswp file and the directory name for the swap file, in bold above.
  11. Correct any other remaining lines referencing the original path or file names.
  12. Save the file and exit the editor.
  13. Rename all the remaining files, except the .vmx configuration file, to the new names.

    For example:

    # mv "originalname.nvram" "newname.nvram"
  14. Change directory to the parent directory:

    # cd ..
  15. Rename the directory for the virtual machine:

    # mv "originalname" "newname"
  16. Using the VMware vSphere Client, browse the datastore and navigate to the renamed virtual machine directory.
  17. Right-click the virtual machine's new configuration file (for example, newname.vmx) and select Add to inventory.

    Alternatively, you can use this command to add the virtual machine to the inventory:

    For ESX:

    # vmware-cmd -s register "/vmfs/volumes/DatastoreName/newname/newname.vmx"

    For ESXi:

    # vim-cmd solo/registervm /vmfs/volumes/DatastoreName/newname/newname.vmx
  18. Power on the virtual machine.
  19. A question for the virtual machine displays in the Summary tab during power-on. Review the question by:
    • Clicking the Summary tab.
    • Right-clicking the virtual machine in your inventory and selecting Answer question.

      When prompted, select I moved it, then click OK.

      Warning: Selecting I copied it results in a change of the virtual machine's UUID and MAC address, which may have detrimental effects on guest applications that are sensitive to MAC address changes, and virtual machine backups that rely on UUIDs.
  20. Optionally delete the original virtual machine configuration file.

    For example:

    # rm /vmfs/volumes/DatastoreName/newname/originalname.vmx

12 Things You Must Do When Running a Solid State Drive in Windows 7

By Miguel Leiva-Gomez 11th May 2012

While reading through forums, I’ve noticed that a ton of people are now using solid state drives (SSDs) instead of hard disk drives (HDDs) for their operating system partition and, sometimes, for the entire computer’s storage. That’s all fine and dandy, but if you run an SSD, you pretty much don’t benefit as much from it as you would if you knew how to prepare your operating system for it. Windows 7 supports certain features that SSDs need to operate at optimum velocity, but it doesn’t enable them by default. This means that you have to come in and change OS settings to support the full potential of your SSD. Let’s get down to it!

1. Enable AHCI

The Advanced Host Controller Interface (AHCI) is a paramount feature for ensuring that Windows will support all of the features that come with running an SSD on your computer, especially the TRIM feature, which allows Windows to help the SSD perform its routine garbage collection. The term “garbage collection” is used to describe the phenomenon that occurs when a drive gets rid of information that is no longer considered to be in use.
To enable AHCI, you’ll have to enter the BIOS of your computer and enable it somewhere within its settings. I can’t tell you exactly where the setting is, as each BIOS functions differently. You’ll have to do a bit of hunting. Chances are that newer computers will have this enabled by default. It’s most recommended that you enable this feature before installing the operating system, although you might be able to get away with enabling it after Windows has already been installed.

2. Enable TRIM

We’ve talked about TRIM enough in the previous section. You could see how such a feature would benefit your computer’s speed greatly, so let’s get to enabling it!
Open up your command prompt and enter the following: 
fsutil behavior  disabledeletenotify 
That’s all you have to do! Onto the next step!

3. Disable System Restore

This isn’t an obligation. But, just so you know, your drive doesn’t exactly have infinite space. System restore undermines both the speed and space of your SSD. Why don’t you just get rid of it?
Click your Start menu, right-click “Computer,” and click “Properties.” Click “System Protection” on the upper left-hand corner:
Once in the window, click “Configure,” like so:
Once in the configuration dialog, click “Turn off system protection.” Click “OK” and you’re all set!

4. Disable Indexing

A good part of your SSD speed is consumed in indexing files for Windows search. This could be useful if you store everything you have on your SSD, but you might be annoyed by it if you experience slow-downs due to the periodic indexing process that occurs every time you add new data to the drive. You’re better off without it in an SSD, because the speed boost from the indexing process is superfluous in such environments.
Click your Start menu and click “Computer.” Right-click your SSD and click “Properties.” De-select the box labeled “Allow files to have contents indexed in addition to file properties” and click “OK.” Once you do this, the operating system will apply this to all the files and folders on the drive. If you see a dialog telling you that it couldn’t remove a file from the index, click “Ignore All.” That will streamline the process and ignore any errors.

5. Disable Scheduled Defragmentation

Because the SSD is a solid media with no moving parts, you often don’t see a performance drop due to file fragmentation. Therefore, there’s no need to actually defragment the drive as frequently as you would defragment an HDD, per se. That’s why we’re about to disable this!
Access your Start menu, click “Accessories,” click “System Tools,” and then click “Disk Defragmenter.” Click “Configure schedule,” like so:
Once in the schedule configuration window, uncheck the box labeled “Run on a schedule.” Click “OK,” and you won’t have to worry about scheduled defragmentations again.

6. Remove The Page File

The page file in Windows refers to a file on a disk reserved for the storage of application components that would otherwise fit into physical memory. It’s like a form of RAM on your hard drive. Disabling the page file on a solid state drive would greatly increase the focus it would have on running system processes. Don’t do this if you run your computer solely on one SSD. If you paired an SSD with an HDD, then you can easily configure the HDD to handle the page file. The most ideal setup, though, is one SSD to run the page file, another SSD to run Windows, and an HDD for storage.
The process of configuring the page file differs based on your setup, so we’re only going to teach you how to reach the configuration window.
Right-click “Computer” in the Start menu and click “Properties.” Click “Advanced system settings” on the top left-hand side of the window and access the “Advanced” tab. Click “Settings” under “Performance.” You should now be at a window like this:
Click the “Advanced” tab and click “Change.” The rest of the configuration process should be easy enough!

7. Disable Hibernation

Windows occupies at least 2 GB for the hibernation state image. If you want to keep it, that’s fine by me, but you’re not getting all the juice you can out of your drive. Type “powercfg -h off” in your command line to disable it. You’ll be thankful for those two extra gigabytes when you have an intense game to install on it!

8. Disable Prefetch and Superfetch

Windows sometimes places information in your physical memory and virtual memory belonging to programs that you don’t currently use, but use very often. This is known as “Prefetch” and “Superfetch.” If you are stuck with having to cope with virtual memory on your SSD, you’re better off just doing away with these two features. You can find them on your registry editor under
HKEY_LOCAL_MACHINE\CurrentControlSet\Control\SessionManager\Memory Management\PrefetchParameters
as two values: EnablePrefetcher and EnableSuperfetch. Set both values to zero and be done with it!

9. Configure Write Caching

On many SSDs, user level write caching can have a detrimental effect on the drive. To figure this out, you’ll have to disable the option in Windows and see how the drive performs afterwards. If your drive performs worse, enable it again.
To reach the configuration window, right-click “Computer” on the Start menu and click “Properties.” Click “Device manager,” expand “Disk Drives,” right-click your SSD, and click “Properties.” Select the “Policies” tab. In this tab, you’ll see an option labeled “Enable write caching on the device.”
Benchmark your SSD with and without the option and compare results.

10. Disable Services for Windows Search and Superfetch

Even with the above-mentioned registry tweak and index removal, your computer might continue slowing your hard drive with their respective services. Press “Win+R” on your keyboard, type “services.msc,” and press “Enter.” Find both services mentioned in the title of this section and disable them.

11. Disable ClearPageFileAtShutdown and LargeSystemCache

Windows is quick to implement things that are no longer necessary. An SSD operates on flash memory, making it possible to easily overwrite things on the disk. Therefore, the page file doesn’t need to be erased while the computer’s shutting down. This will make the Windows shutdown process much faster. LargeSystemCache, on the other hand, exists primarily in Server versions of Windows, and tells the computer whether to use a large cache for pages on the drive.
Both these options are found in your registry editor under
HKEY_LOCAL_MACHINE\CurrentControlSet\Control\SessionManager\Memory Management
Set them to 0.

12. Set the “High Performance” Power Option

This should be a no-brainer. When your SSD powers on and off all the time, you’ll notice a slight lag whenever you use your computer after you’ve been idle for a while.
To switch your power options, access your control panel, click “System and Security,” and then click “Power Options.” Select “High Performance” from the list. You might need to click “Show additional plans” to find it.

The Finale


And that’s how you reach SSD Nirvana! If you have any questions, shoot them at us in the comments section, and we’ll get to you as soon as we can!

Installing an SSL Certificate in Microsoft IIS 5 & 6


To Install the Intermediate SSL Certificate

  1. Click Start , and then click Run...
  2. Type mmc, and then click OK. The Microsoft Management Console (Console 1) opens.
  3. From the File menu, click Add/Remove Snap-in... .
  4. Click Add.
  5. Select Certificates, and then click Add.
  6. Select Computer Account, and then click Next.
  7. Select Local Computer, then click Finish.
  8. Close the Add Standalone Snap-in window.
  9. In the Add/Remove Snap-ins window, click OK.
  10. In the Console 1 window, click + to expand the Certificates folder.
  11. Right-click the Intermediate Certification Authorities folder, mouse-over All Tasks, and then click Import.
  12. Click Next.
  13. Click Browse to find the certificate file.
  14. In the Open window, select *.p7b for the Files of type.
  15. Select the appropriate intermediate certificate file, and then click Open.
  16. In the Certificate Import Wizard window, click Next.
  17. Select Place all certificates in the following store, and then click Browse.
  18. In the Select Certificate Store window, select Intermediate Certification Authorities, and then click OK.
  19. In the Certificate Import Wizard, click Next.
  20. Click Finish, and then click OK.
  21. Close the Console 1 window, and then click No to remove the console settings.

To Install the Primary SSL Certificate

  1. Click Start, select Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. Click + next to your local computer.
  3. Click + next to Web Sites.
  4. Right-click the website or host name for your certificate, and then click Properties.
  5. In the Default Web Site Properties window, click Directory Security.
  6. Click Server Certificate, and then click Next.
  7. In the IIS Certificate Wizard window, select Process the pending request and install the certificate, and then click Next.
  8. Click Browse.
  9. In Open window, select All files (*.*) for Files of type:, select your .crt file, and then click Open.
  10. In the IIS Certificate Wizard window, click Next.
  11. Enter the port you want your website to use, and then click Next.
  12. Verify the Certificate Summary, and then click Next.
  13. Click Finish.

How to Easily Recognize Web Colors from RGB Codes

If you’ve ever customized the design of your HTML website, or tried changing the background color of your social profiles, you’ve probably encountered Hexadecimal color codes. These are a string of 6 characters – like “0066FF” – that you know represent colors but we rarely make the effort to understand them.

Here is a simple guide to help you recognize web colors more quickly from their RGB codes. No more guessing or consulting the color palettes.

In a typical web representation #RRGGBB, the first 2 digits denote red, the second 2 digital are for green and while the last 2 digit represent the blue shade.

Each number denotes the strength of that particular color – FF0000 is only red (no green, no blue), 00FF00 only green (no red, no blue). If all colors are present in equal strength FFFFFF, you get white, if no color is present 000000, you get full black.

If you want to “darken” a color, you need to move the color towards black 000000. That means 880000 is darker than BB0000 that is darker than FF0000.

Similarly, if you want to “lighten” a color, move towards white FFFFFF. So, FF8888 is lighter than FF4444 that is lighter than FF0000

Color combinations are dictated by the “strongest” color. So BB8844 is a reddish shade, 33CC00 would be a little green, and 777777 gray (since it has no strongest color).

Similarly, the RGB code for Facebook blue is #3B5998 which is predominantly blue color.

If you’re uncomfortable with Hexadecimal arithmetic, you could use the standard Windows calculator in scientific mode to perform such calculations. Hexadecimal numbers use 16 unique symbols (0-F) as opposed to the Decimal number system’s 10 (0-9), and to make up for the extra 6 characters, the English alphabets A-F are used.


This story, How to Easily Recognize Web Colors from RGB Codes, was originally published at Digital Inspiration on 18/08/2014 under Colors, Web Design

Monday, January 4, 2016

Raspian setup

sudo apt-get update

sudo apt-get install vpnc

sudo chmod +rwx /etc/vpnc/

sudo apt-get install freerdp

sudo apt-get install zenmap

sudo apt-get install iceweasel

VPNC commands

vpnc <profile name>

killall vpnc

vpnc-disconnect