taken from a real windows... no photoshop.
2013. június 22., szombat
2013. június 13., csütörtök
XenServer VM creation
As I promised earlier. If you want to create a new virtual machine in XenServer or XCP from an ISO file in the CLI and don't want to download it on-the-fly, here are the steps you should take.
Let's assume that you have only one 650megs cd image. Your 4 gigs size root fs will be enough to host that. If you have a dvd image or you want to store more then one cd image, it won't fit. Then, you have to create a new partition with LVM tools. So:
lvcreate -L15G -n /dev/VG_XenStorage-[PRESS_TAB_HERE]/MYISOS
mkfs.ext3 /dev/VG_XenStorage-[PRESS_TAB_HERE]/MYISOS
mkdir -p /myfiles/ && mount /dev/VG_XenStorage-[PRESS_TAB_HERE]/MYISOS /myfiles
Having done, here is the second step. Create a new Storage Repository.
xe sr-create name-label=MY-LITTLE-SR type=iso device-config:location=/myfiles/ device-config:legacy_mode=true content-type=iso
You'll see something like this cd0423d8-23db-5af4-bd70-43b60c901e17
That's the UUID of your newly created storage. Now, copy your install iso file, from example from an USB key:
cp /mnt/sdc1/CentOS-6.0-x86_64-LiveCD.iso /myfiles/
xe sr-scan uuid=cd0423d8-23db-5af4-bd70-43b60c901e17
xe cd-list
(always use TAB!). The reply is:
xe vm-install template=Other\ install\ media new-name-label=MY-LITTLE-VM sr-uuid=$(xe sr-list name-label="Local storage" --minimal)
a69f7844-1c4f-7e44-e072-978de5c1788c
That means you have succesfully created your VM on the disk storage named Local storage. (Default place to put VM's on.). Let's create a virtual interface for this machine and bind it to the physical interface eth0.
xe vif-create network-uuid=$(xe network-list name-label="Pool-wide network associated with eth0" --minimal) vm-uuid=$(xe vm-list name-label=MY-LITTLE-VM --minimal) device=0
It's time to create a new 25Gigs virtual disk and mount it to the VM as a Virtual Block Device.
xe vdi-create name-label=root-MY-VM sr-uuid=$(xe sr-list name-label="Local storage" --minimal) type=system virtual-size=25GiB sharable=false
xe vdb-create vdi-uuid=$(xe vdi-list name-label=root-MY-VM --minimal) vm-uuid=$(xe vm-list name-label=MY-LITTLE-VM --minimal) type=Disk bootable=true device=0
So far so good. Now, load the CD and set a new fixed RAM size, overwriting the template setting.
xe vm-cd-add vm=MY-LITTLE-VM cd-name=CentOS-6.0-x86_64-LiveCD.iso device=1
xe vm-memory-limits-set vm=MY-LITTLE-VM static-min=512MiB static-max=512MiB dynamic-min=512MiB dynamic-max=512MiB
To delegate a virtual quad-core vCPU to the VM:
xe vm-param-set platform:cores-per-socket=4 uuid=$(xe vm-list name-label=MY-LITTLE-VM --minimal)
or set the max virtual CPUs number to 8. (That's the number that a physical quad-core can drive)
xe vm-param-set VCPUs-max=8 uuid=$(xe vm-list name-label=MY-LITTLE-VM --minimal)
Now, fire up the VM and switch to its console:
xe vm-start name-label=MY-LITTLE-VM
xe console vm=MY-LITTLE-VM
Exit the console with: CTRL+5
Sometimes it is useful to identify your virtual network cards VIFs in connection with your VMs. Remember this command:
xe vm-list is-control-domain=false params=dom-id,name-label,uuid
It will tell your VMs' domain IDs. Just watch your ifconfig output and match the VIFs' IDs (vifx.y) to your VM domains' IDs. (x is your VM, y is the device number.)
While investigating which damn vlan, bridge, vif or whatever interface bound to what and where, this is the MOST USEFUL command I've ever seen:
brctl show
Let's assume that you have only one 650megs cd image. Your 4 gigs size root fs will be enough to host that. If you have a dvd image or you want to store more then one cd image, it won't fit. Then, you have to create a new partition with LVM tools. So:
lvcreate -L15G -n /dev/VG_XenStorage-[PRESS_TAB_HERE]/MYISOS
mkfs.ext3 /dev/VG_XenStorage-[PRESS_TAB_HERE]/MYISOS
mkdir -p /myfiles/ && mount /dev/VG_XenStorage-[PRESS_TAB_HERE]/MYISOS /myfiles
Having done, here is the second step. Create a new Storage Repository.
xe sr-create name-label=MY-LITTLE-SR type=iso device-config:location=/myfiles/ device-config:legacy_mode=true content-type=iso
You'll see something like this cd0423d8-23db-5af4-bd70-43b60c901e17
That's the UUID of your newly created storage. Now, copy your install iso file, from example from an USB key:
cp /mnt/sdc1/CentOS-6.0-x86_64-LiveCD.iso /myfiles/
xe sr-scan uuid=cd0423d8-23db-5af4-bd70-43b60c901e17
xe cd-list
(always use TAB!). The reply is:
xe vm-install template=Other\ install\ media new-name-label=MY-LITTLE-VM sr-uuid=$(xe sr-list name-label="Local storage" --minimal)
a69f7844-1c4f-7e44-e072-978de5c1788c
That means you have succesfully created your VM on the disk storage named Local storage. (Default place to put VM's on.). Let's create a virtual interface for this machine and bind it to the physical interface eth0.
xe vif-create network-uuid=$(xe network-list name-label="Pool-wide network associated with eth0" --minimal) vm-uuid=$(xe vm-list name-label=MY-LITTLE-VM --minimal) device=0
It's time to create a new 25Gigs virtual disk and mount it to the VM as a Virtual Block Device.
xe vdi-create name-label=root-MY-VM sr-uuid=$(xe sr-list name-label="Local storage" --minimal) type=system virtual-size=25GiB sharable=false
xe vdb-create vdi-uuid=$(xe vdi-list name-label=root-MY-VM --minimal) vm-uuid=$(xe vm-list name-label=MY-LITTLE-VM --minimal) type=Disk bootable=true device=0
So far so good. Now, load the CD and set a new fixed RAM size, overwriting the template setting.
xe vm-cd-add vm=MY-LITTLE-VM cd-name=CentOS-6.0-x86_64-LiveCD.iso device=1
xe vm-memory-limits-set vm=MY-LITTLE-VM static-min=512MiB static-max=512MiB dynamic-min=512MiB dynamic-max=512MiB
To delegate a virtual quad-core vCPU to the VM:
xe vm-param-set platform:cores-per-socket=4 uuid=$(xe vm-list name-label=MY-LITTLE-VM --minimal)
or set the max virtual CPUs number to 8. (That's the number that a physical quad-core can drive)
xe vm-param-set VCPUs-max=8 uuid=$(xe vm-list name-label=MY-LITTLE-VM --minimal)
Now, fire up the VM and switch to its console:
xe vm-start name-label=MY-LITTLE-VM
xe console vm=MY-LITTLE-VM
Exit the console with: CTRL+5
Sometimes it is useful to identify your virtual network cards VIFs in connection with your VMs. Remember this command:
xe vm-list is-control-domain=false params=dom-id,name-label,uuid
It will tell your VMs' domain IDs. Just watch your ifconfig output and match the VIFs' IDs (vifx.y) to your VM domains' IDs. (x is your VM, y is the device number.)
While investigating which damn vlan, bridge, vif or whatever interface bound to what and where, this is the MOST USEFUL command I've ever seen:
brctl show
2013. június 6., csütörtök
Hardening Hyper-V 2012 clusters, Deployment Bible
I've came across an awesome article, originally on http://social.technet.microsoft.com/Forums/en-US/winserverhyperv/thread/61e18aaf-de6a-42e7-aa41-3cee790a1236/. In case it disappers I'm taking an exact copy of it. I do hope it wont violate any law. :P Thanks Roger Osborne, anyway.
[...]
[...]
GENERAL (HOST):
⎕
Use Server Core, or the Windows Minimal Interface, to reduce OS
overhead, reduce the potential attack surface, and to minimize reboots
(due to fewer software updates).
- Server Core information: http://msdn.microsoft.com/en-us/library/windows/desktop/hh846313(v=vs.85).aspx
- Windows Minimal Interface Information: http://msdn.microsoft.com/en-us/library/windows/desktop/hh846317(v=vs.85).aspx
⎕
Ensure hosts are up-to-date with recommended Microsoft updates, to
ensure critical patches and updates – addressing security concerns or
fixes to the core OS – are applied.
⎕ Ensure all applicable Hyper-V hotfixes and Cluster hotfixes
(if applicable) have been applied. Review the following sites and
compare it to your environment, since not all hotfixes will be
applicable:
- A fellow Microsoft employee, Cristian Edwards, has recently posted a PowerShell script that detects which Hyper-V and Failover Clustering 2012 updates you are missing based on the list updated by the Microsoft Product Group! Check it out here: http://blogs.technet.com/b/cedward/archive/2013/05/24/validating-hyper-v-2012-and-failover-clustering-2012-hotfixes-and-updates-with-powershell.aspx
- Update List for Windows Server 2012 Hyper-V: http://social.technet.microsoft.com/wiki/contents/articles/15576.hyper-v-update-list-for-windows-server-2012.aspx
- List of Failover Cluster Hotfixes: http://social.technet.microsoft.com/wiki/contents/articles/15577.list-of-failover-cluster-hotfixes-for-windows-server-2012.aspx
- Failover Cluster Management snap-in crashes after you install update 2750149 on a Windows Server 2012-based failover cluster:
⎕
Ensure hosts have the latest BIOS version, as well as other hardware
devices (such as Synthetic Fibre Channel, NIC’s, etc.), to address any
known issues/supportability
⎕
Host should be domain joined, unless security standards dictate
otherwise. Doing so makes it possible to centralize the management of
policies for identity, security, and auditing. Additionally, hosts must
be domain joined before you can create a Hyper-V High-Availability
Cluster.
· For more information: http://technet.microsoft.com/en-us/library/ee941123(v=WS.10).aspx
⎕
RDP Printer Mapping should be disabled on hosts, to remove any chance
of a printer driver causing instability issues on the host machine.
- Preferred method: Use Group Policy with host servers in their own separate OU
- Computer Configuration –> Policies –> Administrative Templates –> Windows Components –> Remote Desktop Services –> Remote Desktop Session Host –> Printer Redirection –> Do not allow client printer redirection –> Set to "Enabled
⎕
Do not install any other Roles on a host besides the Hyper-V role and
the Remote Desktop Services roles (if VDI will be used on the host).
- When the Hyper-V role is installed, the host OS becomes the "Parent Partition" (a quasi-virtual machine), and the Hypervisor partition is placed between the parent partition and the hardware. As a result, it is not recommended to install additional (non-Hyper-V and/or VDI related) roles.
⎕ The only Features that should be installed on the host are: Failover Cluster Manager (if host will become part of a cluster), Multipath I/O (if host will be connecting to an iSCSI SAN, Spaces and/or Fibre Channel), or Remote Desktop Services if VDI is being used. (See explanation above for reasons why installing additional features is not recommended.)
[..]
Read the rest from on Technet or from here.
2013. május 30., csütörtök
XenServer project
Have you ever tried to create virtual machines in the CLI on a XenServer? I can assure you it can be a real pain. How the heck on earth do you attach an iso into the storage repository or why do you need to use that kickstart thingy, or whatever.
You think it's easy, just
xe sr-create name-label=Local type=iso device-config:legacy_mode=true device-config:location=/vm/iso content-type=iso
....then copy the iso onto the server with scp, then...
xe sr-scan uuid=<SR UUID>
xe template-list
Shorty comes the ultimate XenServer CLI VM creation howto.
You think it's easy, just
xe sr-create name-label=Local type=iso device-config:legacy_mode=true device-config:location=/vm/iso content-type=iso
....then copy the iso onto the server with scp, then...
xe sr-scan uuid=<SR UUID>
xe template-list
xe vm-install new-name-label=<VM_NAME> template=<TEMPLATE NAME>
xe cd-list
xe vm-cd-ad vm=<VM_NAME> cd-name=<NAME_ISO.iso> device=3
and finally
xe vm-start vm=<VM-NAME>
Hahaha. Have a look at this then.Shorty comes the ultimate XenServer CLI VM creation howto.
2013. május 23., csütörtök
Exchange 2013 FSW fun
Long time no see. I feel I gotta do some post because really in the need of seeing googlebots coming to my site. Hehh.
Just came across with a funny post. It deserves a share. Have fun.
Obligatory disclaimer: While this is definitely not recommended practise in a production environment, and may have undesirable results, it will probably work. I highly doubt Microsoft support this, though I have been unable to find any concrete evidence on it (frankly, it’s such terrible practise they shouldn’t have to publicise advice against it). If you can come up with a method to avoid following this guide in production, I implore you to do so.
The File Share Witness is used as the winning vote when your DAG has an even number of hosts – the same principle as the quorum drive in a Failover Cluster. This is a file server that all DAG members can read and write (but cannot be a DAG member for obvious reasons).
If you just try to create a DAG and use a domain controller as a FSW, you’ll get this error message:
...."
Read the rest here.
Just came across with a funny post. It deserves a share. Have fun.
"How to use a Domain Controller as an Exchange 2013 DAG Witness Server (Don’t)
If you’re setting up Exchange 2013 in a lab, you may have a requirement to use a domain controller as a File Share Witness (FSW) host.Obligatory disclaimer: While this is definitely not recommended practise in a production environment, and may have undesirable results, it will probably work. I highly doubt Microsoft support this, though I have been unable to find any concrete evidence on it (frankly, it’s such terrible practise they shouldn’t have to publicise advice against it). If you can come up with a method to avoid following this guide in production, I implore you to do so.
The File Share Witness is used as the winning vote when your DAG has an even number of hosts – the same principle as the quorum drive in a Failover Cluster. This is a file server that all DAG members can read and write (but cannot be a DAG member for obvious reasons).
If you just try to create a DAG and use a domain controller as a FSW, you’ll get this error message:
...."
Read the rest here.
2013. március 22., péntek
Nagios install (phew...okay I know...) on CentOS
We have to admit that all the IT folks should avoid using Nagios nowadays 'cause there are lots of nicer apps out there. Anyway, let's do this. I'm pretty sure you have read this but as a quick side note, you may want to consider also reading this. A working solution comes out of these two ones.
But wait. Compiling plugins on a brand new CentOS install drops an error:
After half a minute long interaction with my friend Google, I found that I should do a simple apt-get install libssl-dev to exorcise the the problem. Okay but I have no such package on CentOS and don't want to go with the nuisance of making one from source. Openssl-devel package doesn't help either.
Huhh. What a mess. Solution: have a look at the pic. Fix that file in plugins/ according to this and ./configure && make all again.
But wait. Compiling plugins on a brand new CentOS install drops an error:
check_http.c:312:9: error: ‘ssl_version’ undeclared (first use in this function)
After half a minute long interaction with my friend Google, I found that I should do a simple apt-get install libssl-dev to exorcise the the problem. Okay but I have no such package on CentOS and don't want to go with the nuisance of making one from source. Openssl-devel package doesn't help either.
Huhh. What a mess. Solution: have a look at the pic. Fix that file in plugins/ according to this and ./configure && make all again.
2013. március 5., kedd
my little handy backup from php
<?php
if ($_POST){
$nap=stripslashes($_POST['nap']);
exec ("find /var/www/ize -not -name \"backup_*\" -a -not -name \"backup.php\" -a -not -name \"*.zip\" -a -not -name \"error.log\" -a -not -path \"*/zend*\" -a -not -path \"*tmp/*\" -a -not -path \"*images/*\" -a -not -path \"*fotok*\" -type f -mtime -$nap > lista");
$fajl = "backup_".`date +%F_%H%M`.".tar.gz";
$output = `tar -cvzf /var/www/ize/backup_\`date +%F_%H%M\`.tar.gz --files-from lista`;
echo "DONE!";
echo "<a href=\"$fajl\">backup</a>";
echo "<pre>$output</pre>";
} else {
?>
<form action="backup.php" method="post">
file age limit to be backuped ?
<input type="text" name="nap" id="nap" cols="2" rows="1">
<button class="button" type="submit">GO</button>
</form>
<?php }; ?>
Feliratkozás:
Bejegyzések (Atom)
