Skip to main content

Building a DevStation

A best practice when administrating and managing your production workload system in the real-world is through a jump-box type like machine in which can access directly and as a gateway towards your production machines. We will liken this jump-box like a developer workstation-DevStation where management tools and it dependencies can all be installed into a single location to faciliate those connections. It can also be rather handy as a machine where you can write your scripts to be deployed against them.

This is entirely an optional exercise as without this, you can still complete all the labs given.

However, if a DevStation is for you, please continute with the rest of this section to build your own dream DevStation!

Deploying a Linux VM

  1. In Prism Central > select Menu > Compute and Storage > VMs, and click Create VM.

  2. Fill out the following fields:

    • Name: Initials-Linux-ToolsVM
    • Description: (Optional) Description for your VM.
    • Number of VMs: 1
    • CPU(s): 4
    • Number of Cores per CPU: 1
    • Memory: 4 GiB
  3. Click Next.

  4. Under Disks select Attach Disk

    • Type: DISK
    • Operation: Clone from Image
    • Image: Linux_ToolsVM.qcow2
    • Capacity: leave at default size
    • Bus Type: leave at default SCSI Setting
  5. Click Save

  6. Under Networks select Attach to Subnet

    • VLAN Name: Primary
    • Network Connection State: Connected
    • Assignment Type: - Assign with DHCP
  7. Click Save

  8. Click Next at the bottom

  9. In Management section

    • Categories: leave blank

    • Timezone: leave at default UTC

    • Guest Customization: -

      • Script Type: Cloud-init (Linux)

      • Configuration Method: Custom Script

        #cloud-config

        # Set the hostname
        hostname: myhost

        # Create a new user
        users:
        - default
        - name: nutanix
        groups: wheel, users
        ssh_authorized_keys:
        # Paste the generated public key here
        - ssh-rsa AAAAB3NzaC1....
        # You can also use the salter 1N or 6N format using OPENSSL (openssl passwd -1 -salt SaltSalt "yourplaintextpassword")
        # Paste the generated password here
        passwd: $1$SaltSalt$aOsqVFP2QULyFo5JYkOYB/
        shell: /bin/bash
        lock-passwd: false
        ssh_pwauth: True

        # Enable password authentication for root
        ssh_pwauth: True

        # Run additional commands
        runcmd:
        - 'sleep 10' # sleeping for the network to be UP
        - 'echo "nutanix ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers'

        # Run package upgrade
        package_upgrade: true

        # Install the following packages - add extra that you would need
        packages:
        - git
        - bind-utils
        - nmap
        - curl
        - wget
        - vim
        - python3
        - python3-pip
  10. Click on Next.

  11. Click Create VM at the bottom.

  12. Go back to Prism Central > Menu > Compute and Storage > VMs.

  13. Select your _initials_Linux-ToolsVM.

  14. Under Actions drop-down menu, choose Power On.

note

It may take up to 10 minutes for the VM to be ready.

You can watch the console of the VM from Prism Central to make sure all the clouinit script has finished running.

  1. Login to the VM via SSH or Console session, using the following command:

    ssh -i <your_private_key> -l nutanix <IP of LinuxToolsVM>