Difference between revisions of "Proxmox ISCSI installation"

From Proxmox VE
Jump to navigation Jump to search
(Created page with "Note : text formatting is still to do = What is iSCSI? = iSCSI is a protocol who can travel SCSI's commands over the network. The main advantage is that you don't need any hard…")
 
Line 1: Line 1:
Note : text formatting is still to do
+
Note : text formatting is still to do  
  
= What is iSCSI? =
+
= What is iSCSI? =
  
iSCSI is a protocol who can travel SCSI's commands over the network. The main advantage is that you don't need any harddrives for getting a fully functional server. This can be also realized by using a real FiberChannel SAN but it's a lot more expensive. A diskless server will boot over the network, asking its disk image to the SAN. Today, a lot of system supports iSCSI but they don't really support iSCSI install and boot (only VMWare supports that). However, you can making this works on some Linux's system by making some tricks and that's what we will see .
+
iSCSI is a protocol who can travel SCSI's commands over the network. The main advantage is that you don't need any harddrives for getting a fully functional server. This can be also realized by using a real FiberChannel SAN but it's a lot more expensive. A diskless server will boot over the network, asking its disk image to the SAN. Today, a lot of system supports iSCSI but they don't really support iSCSI install and boot (only VMWare supports that). However, you can making this works on some Linux's system by making some tricks and that's what we will see .  
  
= What do you need? =
+
= What do you need? =
  
You need a functionnal iSCSI target (OpenFiler can be a good solution) and your diskless server must support iSCSI boot (if not, you can use iPXE for that). You also need a DHCP server for network booting. You can find some tutorials about iPXE (formely gPXE) on the gPXE wiki : http://etherboot.org/wiki/start
+
You need a functionnal iSCSI target (OpenFiler can be a good solution) and your diskless server must support iSCSI boot (if not, you can use iPXE for that). You also need a DHCP server for network booting. You can find some tutorials about iPXE (formely gPXE) on the gPXE wiki : http://etherboot.org/wiki/start  
  
= Here we go ! =
+
= Here we go ! =
  
'''1 -''' Install a clean ''Debian'' on a physical machine or into a VM. Using a VM is not a problem because we only need this for formating and installing another Debian on the iSCSI target.
+
<u>'''1 -'''</u> Install a clean ''Debian'' on a physical machine or into a VM. Using a VM is not a problem because we only need this for formating and installing another Debian on the iSCSI target.  
  
'''2 -''' Install ''open-iscsi'' ('''aptitude install open-iscsi'''). This util manages to attach an iSCSI target to the session.
+
<u>'''2 -''' </u>Install ''open-iscsi'' ('''aptitude install open-iscsi'''). This util manages to attach an iSCSI target to the session.<br>
  
'''3 -''' Attach the ''iSCSI target'' ('''iscsiadm --mode node --targetname <IQN> -p <IP> --login'''). You should now see your iSCSI target into /dev/sdX.
+
<u>'''3 -'''</u> Attach the ''iSCSI target'' ('''iscsiadm --mode node --targetname &lt;IQN&gt; -p &lt;IP&gt; --login'''). You should now see your iSCSI target into /dev/sdX.  
  
'''Example :''' ''iscsiadm --mode node --targetname iqn.2006-01.openfiler.com:tsn.dcb5e30d5a -p 188.102.200.254 --login''
+
'''Example&nbsp;:''' ''iscsiadm --mode node --targetname iqn.2006-01.openfiler.com:tsn.dcb5e30d5a -p 188.102.200.254 --login''  
  
'''4 -''' Create all ''partitions'' you need for your future Debian installation (you can use ''gpart'' for exemple).
+
<u>'''4 -'''</u> Create all ''partitions'' you need for your future Debian installation (you can use ''gpart'' for exemple).  
  
'''NOTE :''' '''The first partition must begin at the 2048 sector !!! If don't, you will not be able to install Grub on the iSCSI target !'''
+
<u>'''NOTE&nbsp;:'''</u> '''The first partition must begin at the 2048 sector&nbsp;!!! If don't, you will not be able to install Grub on the iSCSI target&nbsp;!'''  
  
'''5 -''' Create a dir into /mnt (for example /mnt/debian) for preparing ''mouting''.
+
<u>'''5 -'''</u> Create a dir into /mnt (for example /mnt/debian) for preparing ''mouting''.  
  
'''6 -''' Mount the'' iSCSI target's'' main partition on this dir ('''mount /dev/sdX1 /mnt/debian''')
+
<u>'''6 -'''</u> Mount the''iSCSI target's'' main partition on this dir ('''mount /dev/sdX1 /mnt/debian''')  
  
'''7 -''' Install ''debootstrap'' ('''aptitude install debootstrap'''). This utils manages to install a light debian install by using deb packages to a target.
+
<u>'''7 -'''</u> Install ''debootstrap'' ('''aptitude install debootstrap'''). This utils manages to install a light debian install by using deb packages to a target.  
  
'''8 -''' Install a ''debian squeeze'' to /mnt/debian by using debootstrap ('''debootstrap squeeze /mnt/debian http://ftp.us.debian.org/debian'''). You can also install another debian like lenny, but squeeze supports iSCSI better (you need to do more tricks on Lenny for having a functional iscsi boot). This can take some time (depending on your connection).
+
<u>'''8 -'''</u> Install a ''debian squeeze'' to /mnt/debian by using debootstrap ('''debootstrap squeeze /mnt/debian http://ftp.us.debian.org/debian'''). You can also install another debian like lenny, but squeeze supports iSCSI better (you need to do more tricks on Lenny for having a functional iscsi boot). This can take some time (depending on your connection).<br><br> <u>'''You should now have a right lightweight Squeeze install on the main partition'''</u>
  
 +
<br> <u>'''9 -'''</u> ''Mount'' this system's dirs, it is necessary for preparing the new squeeze installation for iscsi booting.
  
'''You should now have a right lightweight Squeeze install on the main partition !'''
+
'''mount -o bind /dev /mnt/debian/dev'''<br>'''mount -o bind /sys /mnt/debian/sys'''<br>'''mount -o bind /proc /mnt/debian/proc'''<br> <u>'''10 -''' </u>Use now this Debian by using chroot (who can change the root dir by another dir).
  
 +
'''chroot /mnt/debian'''
  
'''9 -''' Mount this system's dirs, it is necessary for preparing the new squeeze installation for iscsi booting.
+
<br> <u>'''You are now logged on your new system'''</u>
  
'''mount -o bind /dev /mnt/debian/dev'''
+
<br> <u>'''11 -'''</u> Install ''Grub'' ('''aptitude install grub'''). It should install Grub into the MBR of your iSCSI target. If not, you can use grub-install /dev/sdX.
  
'''mount -o bind /sys /mnt/debian/sys'''
+
<u>'''12 -'''</u> Add the ''Proxmox repository'' ('''echo deb http://download.proxmox.com/debian lenny pve &gt;&gt; /etc/apt/sources.list''') and update ('''aptitude update''')
  
'''mount -o bind /proc /mnt/debian/proc'''
+
<u>'''13 -'''</u> Add the ''loopback interface'' (if don't, you will not be able to use nfs-common who is needed by the pve-manager). For this&nbsp;: <br>'''nano /etc/network/interfaces'''  
  
 +
Add this to the file&nbsp;: <br>'''auto lo <br>iface lo inet loopback'''
  
'''10 -''' Use now this Debian by using chroot (who can change the root dir by another dir).
+
<u>'''14 -''' </u>Install the ''proxmox 2.6.32-4 kernel and headers'' (the 2.6.35 seems to not work with iscsi booting) ('''aptitude install pve-kernel-2.6.32-4-pve pve-headers-2.6.32-4-pve'''). This action should update grub automatically.  
  
'''chroot /mnt/debian'''
+
<u>'''15 -'''</u> Install ''open-iscsi'' for making this installation fully supports iSCSI ('''aptitude install open-iscsi''').
  
 +
<u>'''16 -'''</u> Precise to open-iscsi to manage ''iBFT informations'' (iBFT are informations made by iSCSI boot firmware like iPXE for the system) <br>'''echo "ISCSI_AUTO=true" &gt; /etc/iscsi/iscsi.initramfs'''
  
'''You are now logged on your new system'''
+
By using this, you don't have to precise the iSCSI IQN and the iSCSI Target's IP to the system, only iscsi boot firmware need this.
  
 +
'''17 -''' Install ''initramfs-tools'' ('''aptitude install initramfs-tools''') and update initramfs ('''update-initramfs -u''')
  
'''11 -''' Install Grub ('''aptitude install grub'''). It should install Grub into the MBR of your iSCSI target. If not, you can use grub-install /dev/sdX.
+
'''18 -''' Create a ''root password'' ('''passwd''')  
  
'''12 -''' Add the Proxmox repository ('''echo deb http://download.proxmox.com/debian lenny pve >> /etc/apt/sources.list''') and update ('''aptitude update''')
+
<br> Your new Debian system should now boot over ''iSCSI''&nbsp;! Once booted you can install proxmox by simply using&nbsp;: '''aptitude install proxmox-ve-2.6.32 ntp ssh lvm2 '''<br>
 
 
'''13 -''' Add the loopback interface (if don't, you will not be able to use nfs-common who is needed by the pve-manager). For this :
 
nano /etc/network/interfaces
 
 
 
Add this to the file :
 
auto lo
 
iface lo inet loopback
 
 
 
'''14 -''' Install the proxmox 2.6.32-4 kernel and headers (the 2.6.35 seems to not work with iscsi booting) (aptitude install pve-kernel-2.6.32-4-pve pve-headers-2.6.32-4-pve). This action should update grub automatically.
 
 
 
'''15 -''' Install open-iscsi for making this installation fully supports iSCSI (aptitude install open-iscsi).
 
 
 
'''16 -''' Precise to open-iscsi to manage iBFT informations (iBFT are informations made by iSCSI boot firmware like iPXE for the system)
 
echo "ISCSI_AUTO=true" > /etc/iscsi/iscsi.initramfs
 
 
 
By using this, you don't have to precise the iSCSI IQN and the iSCSI Target's IP to the system, only iscsi boot firmware need this.
 
 
 
'''17 -''' Install initramfs-tools (aptitude install initramfs-tools) and update initramfs (update-initramfs-u)
 
 
 
'''18 -''' Create a root password (passwd)
 
 
 
 
 
Your new Debian system should now boot over iSCSI ! Once booted you can install proxmox by simply using : aptitude install proxmox-ve-2.6.32 ntp ssh lvm2
 
 
 
If you need any informations about somethings else like iPXE and DHCP install or OpenFiler configuration, please tell me
 

Revision as of 10:17, 13 May 2011

Note : text formatting is still to do

What is iSCSI?

iSCSI is a protocol who can travel SCSI's commands over the network. The main advantage is that you don't need any harddrives for getting a fully functional server. This can be also realized by using a real FiberChannel SAN but it's a lot more expensive. A diskless server will boot over the network, asking its disk image to the SAN. Today, a lot of system supports iSCSI but they don't really support iSCSI install and boot (only VMWare supports that). However, you can making this works on some Linux's system by making some tricks and that's what we will see .

What do you need?

You need a functionnal iSCSI target (OpenFiler can be a good solution) and your diskless server must support iSCSI boot (if not, you can use iPXE for that). You also need a DHCP server for network booting. You can find some tutorials about iPXE (formely gPXE) on the gPXE wiki : http://etherboot.org/wiki/start

Here we go !

1 - Install a clean Debian on a physical machine or into a VM. Using a VM is not a problem because we only need this for formating and installing another Debian on the iSCSI target.

2 - Install open-iscsi (aptitude install open-iscsi). This util manages to attach an iSCSI target to the session.

3 - Attach the iSCSI target (iscsiadm --mode node --targetname <IQN> -p <IP> --login). You should now see your iSCSI target into /dev/sdX.

Example : iscsiadm --mode node --targetname iqn.2006-01.openfiler.com:tsn.dcb5e30d5a -p 188.102.200.254 --login

4 - Create all partitions you need for your future Debian installation (you can use gpart for exemple).

NOTE : The first partition must begin at the 2048 sector !!! If don't, you will not be able to install Grub on the iSCSI target !

5 - Create a dir into /mnt (for example /mnt/debian) for preparing mouting.

6 - Mount theiSCSI target's main partition on this dir (mount /dev/sdX1 /mnt/debian)

7 - Install debootstrap (aptitude install debootstrap). This utils manages to install a light debian install by using deb packages to a target.

8 - Install a debian squeeze to /mnt/debian by using debootstrap (debootstrap squeeze /mnt/debian http://ftp.us.debian.org/debian). You can also install another debian like lenny, but squeeze supports iSCSI better (you need to do more tricks on Lenny for having a functional iscsi boot). This can take some time (depending on your connection).

You should now have a right lightweight Squeeze install on the main partition


9 - Mount this system's dirs, it is necessary for preparing the new squeeze installation for iscsi booting.

mount -o bind /dev /mnt/debian/dev
mount -o bind /sys /mnt/debian/sys
mount -o bind /proc /mnt/debian/proc
10 - Use now this Debian by using chroot (who can change the root dir by another dir).

chroot /mnt/debian


You are now logged on your new system


11 - Install Grub (aptitude install grub). It should install Grub into the MBR of your iSCSI target. If not, you can use grub-install /dev/sdX.

12 - Add the Proxmox repository (echo deb http://download.proxmox.com/debian lenny pve >> /etc/apt/sources.list) and update (aptitude update)

13 - Add the loopback interface (if don't, you will not be able to use nfs-common who is needed by the pve-manager). For this :
nano /etc/network/interfaces

Add this to the file :
auto lo
iface lo inet loopback

14 - Install the proxmox 2.6.32-4 kernel and headers (the 2.6.35 seems to not work with iscsi booting) (aptitude install pve-kernel-2.6.32-4-pve pve-headers-2.6.32-4-pve). This action should update grub automatically.

15 - Install open-iscsi for making this installation fully supports iSCSI (aptitude install open-iscsi).

16 - Precise to open-iscsi to manage iBFT informations (iBFT are informations made by iSCSI boot firmware like iPXE for the system)
echo "ISCSI_AUTO=true" > /etc/iscsi/iscsi.initramfs

By using this, you don't have to precise the iSCSI IQN and the iSCSI Target's IP to the system, only iscsi boot firmware need this.

17 - Install initramfs-tools (aptitude install initramfs-tools) and update initramfs (update-initramfs -u)

18 - Create a root password (passwd)


Your new Debian system should now boot over iSCSI ! Once booted you can install proxmox by simply using : aptitude install proxmox-ve-2.6.32 ntp ssh lvm2