Monday, December 12, 2011

Adding hard disk for Proxmox Storage

SSH into the Proxmox box:


I had to go in with fdisk and clean up my disk before I could add it, I wanted the entire disk visible to proxmox so I cleaned off any of the remaining partitions. You can find out using fdisk -l as you can see here, I needed /dev/sda. Then, you can create the physical volume:
 
Then create the volume group:
 
The storage is then present:
 

Tuesday, December 6, 2011

Architecture Change

Well since moving into the house I have had a little time to tinker with the home lab setup. I have made some drastic changes, as usual, the most drastic here. I am afraid my ESXi box is going by the way side. Here is the issue we face:

As you can see my ESXi is clearly having a problem with my means of storage. I used to have another box in my lab, the iSCSI Fedora box that I wrote about earlier. This is not feasable as I need that machine for other things, and it is kind of defeating the purpose of having an all-in-one virtualization platform. I have decided to make the switch to Windows Server 2008 R2 Server Core with Hyper-V. A tough decision but I am tired of worrying about driver compatability, and I usually do not have to worry about this with Microsoft Operating systems. I have also used the other big two, Xen and ESXi, so I feel I have to be fair, and I might even decide I like this option the best.

Update: things simply are not working with me. I started out by installing a Server Core system, thinking, "a challenge will be nice," and things immediately go sour. I have problems connecting to the remote core system with RSAT, even after enabling winRM and taking all the appropriate steps (setting IP address, host name, etc.) - Microsoft suggests (or perhaps requires is a better word) that you have both the server and the client (in this instance my Windows 7 workstation) joined to a domain. I have no pre-existing domain in my environment. My domain server I have always wanted to virtualize, but since this is structured this way it almost seems like you should always have a MS box over there in the corner running AD/DNS - providing LDAP function essentially; a way to organize and provide central [database-centered] management for your network. (Perhaps I should order another 1U server like my IBM x series 306 for pfSense and run OpenLDAP? Another day...)
 
My idea was to have a one-box-do-all Virtualization solution. With VMware I am not going to get around this issue until I decide to buy a RAID card, and decent one's are pricy. I uninstalled server core and installed the GUI, and more problems. Active directory probably took 4 hours to install. Then, the server takes 10-12 minutes to start up. All the server has running is DNS and ADDS. This is impossible to manage.

I have pretty much scrapped this idea and decided to take a stab at another hypervisor. Another big one I have heard mentioned with great fervor but less commonly, is KVM and Proxmox has this ability. I am not too familiar with KVM but I have used Proxmox before and it looked interesting. We will see how things work out, such as storage hardware/Realtek NIC ability, etc.

Sunday, October 16, 2011

Configuring Fedora as an iSCSI target for VMware ESXi

My Experience:


After much extensive testing, head scratching, and late nights I have figured it out. You would not think setting up an iSCSI target in linux would be that big of a thing, but I was fortunate to have nearly every problem in the book. The frustration started out with a box that for some reason would not let me install things on it. NOTHING. I was originally going to go with OpenFiler, to make things simple. I needed to configure iSCSI because ESXi 5 was not seeing my hard drive. In retrospect, the controller was being seen, just not the hard drive, which leads me to believe with some tweaking I could have made it work, but I guess I just took it as an opportunity to set up iSCSI.

Anyway, this box hated openfiler. The first disk I used had corrupted tar files, others would not get back the initial screen. Installs would fail and drop to intramfs, etc. So I decided to try Ubuntu. Ubuntu was the same story. This machine hated it as well. Dropped to intramfs, wouldn't install (referenced here)
Eventually I got Ubuntu 11.04 server installed and followed the iSCSI setup procedure here but to no avail. In retrospect, it might have been a firewall issue, since I could not get ESXi to see my Fedora iSCSI volumes until turning the firewall completely OFF, but in the end it didn't work and I decided to see whether Fedora 15 would install. I am more familiar with Red Hat anyway since I had a class on it.
Fedora 15 xfce desktop installed beautifully without a hitch. Now to getting iSCSI set up. Note I always update on new installs. (yum update)


Procedure:

 Foreword: It is important to understand the LVM. LVM stands for Linux Logical Volume manager and is composed of

  • PV's (Physical Volumes) - unused partitions on hard disks the LVM can use to store information.
  • VG's (Volume Groups) - contains one or more physical volumes. Represents a pool of hard disk storage space that is available to the LVM for creating volumes. Additional physical volumes can be added to a volume group after creation.
  • LV's (Logical Volumes) - useable volumes that are created by the LVM from the available space in the volume group. They contain a filesystem and are mounted to a directory in the Linux filesystem hierarchy. Logical volumes can be re-sized to use more or less space.

Step 1: Create a physical volume. In this instance we are creating a physical volume out of the second SATA drives first partition. I usually use CFDISK (cfdisk /dev/sdb) to partition the disk to the appropriate size I need. Note that you can list physical volumes with pvdisplay.

pvcreate /dev/sdb1  

Step 2: Create the volume group:


vgcreate -s 32M vg_target00 /dev/sdb1

This command creates a volume group. The -s tack denotes physical extent size (PE). A large PE size results in larger write operations and larger max filesystem size for the logical volumes. In this example we have chosen 32MB which will allow for a max logical volume size of 2TB, which should be sufficient for most users.

vg_target00 is simply the name of the volume group and /dev/sdb1 is the target physical volume.
Step 3: Create the logical volume:

lvcreate -L 100G -n lv_target00 vg_target00

This command creates a logical volume of 100G with the name of lv_target00 (once again, you can make this whatever you want as long as you reflect that in your config files) in the volume group of vg_target00 we created earlier.

Step 4: Install the iSCSI target program:

yum -y install scsi-target-utils

Step 5: Edit the config file:

nano /etc/tgt/targets.conf

There is a lot of garbage in this file, worth reading if you are clueless, but all you really need to look for is the part that starts with #<target and un-comment it. It should look like this:

<target iqn.2011-10.local.iscsi:target00>
backing-store /dev/vg_target00/lv_target00
initiator-address 192.168.1.1
</target>

iqn looks complicated but it is really just iqn.year-month.domain name reversed:pick a name
Save and exit..

Step 6: Start your server

/etc/rc.d/init.d/tgtd start
Step 7: Configure iscsi service to start at boot

chkconfig tgtd on

Note: You can check the status with:

tgtadm --mode target --op show
# make sure status
Note: You may have to disable Fedora's Firewall. If you are in a command line environment issue: 
service iptables stop

Now all you have to do is set it up on the ESXi server: 



 And that's it! Hope this post was helpful.


Thursday, October 6, 2011

SSH on CISCO Router

Here are the steps required to install SSH on a Cisco Router:
First you need to determine if you have the required IOS - IOS images with "K9" in the name will do. Not all routers support SSH. I am using the 2600 series.
Second log into your router and give it a host name with:

hostname R1

You will also need to configure a domain name:

ip domain name your-domain.com

Then use ip ssh to change the version to 2 if possible. You will not always be able to rely on ssh v2, but even version 1 will provide substantially better protection then telnet:

ip ssh version 2

Once you have that done go ahead and enter:

crypto key generate rsa

Then you have the option to choose how many bits the keys will be anywhere between 360 and 2048, I choose 1024 since it is very secure and the router can create the key quickly. The default is 512.
Then the final step. Create a user for ssh login and secure the vty lines:

user username privilege level 15 password yoursupersecrepassword

R1(config)#line vty 0 ?
  <1-181>  Last Line number
  <cr>

R1(config)#line vty 0 181
R1(config-line)#login local
R1(config-line)#trans
R1(config-line)#transport input ssh
R1(config-line)#exit
R1(config)#exit


That is pretty much it! You can now login through putty or other ssh clients.