Author Topic: LMCE newb... what do I need?  (Read 7098 times)

timpj5

  • Making baby steps
  • Posts: 3
    • View Profile
LMCE newb... what do I need?
« on: September 08, 2011, 06:21:17 am »
Ok... so I'm intrigued by LMCE and really want to do both media / entertainment, home automation and security... possibly VOIP.

I'm a technology professional but novice with home automation and security and limited exposure to VOIP aside from 3rd party providers.

Here's my setup...

I currently have a Windows 7 HTPC connected to my HDTV with about a TB of storage (though I'd like to reconfigure this as it's a dynamic disk stripped across (2) 500GB drives and will probably fail soon.  These are almost full of movies.  Currently, I have a wireless card in this machine for access to my WLAN, but the performance is unacceptable when streaming from my NAS to watch 720/1080p movies so...

I have a 20-bay chassis with (10) 1TB drives in 2 RAID sets with a global hotspare for a total of 7TB of usable storage running FreeNAS.

I run a 2-node vSphere cluster with twin IBM xSeries 3500's connected via iSCSI from FreeNAS, each with 8GB of RAM.  I've been thinking about cutting my cluster down to a single node and either using the other one for a core server or getting rid of it altogether (it's very loud and consumes alot of power).

I also run a decent Dell PC as an Untangled router...

I also have a another PC that I run Windows 7 on for my home desktop (as opposed to my work-provided laptop).

All of this is connected to a 48-port managed gig switch capable of VLAN tagging (which currently separates my storage network from my internet accessible network, as well as my ESXi management networks... routed via router on a stick with a Cisco 2651XM router)

Anywho... I'm planning to have my house wired so that I can use my NAS for streaming media as opposed to storing on the the HTPC.  I know I can simply copy my media from the HTPC to the NAS and then use the HTPC as a MD or a hybrid (though I assume I might be better off running the Core on one of my servers).  I have DirecTV and would like to control my DirecTV system via LMCE... I had a Gyration remote but it has died and I haven't yet replaced it.  Do I need to have a TV tuner card to do this?  I recognize that I'll need to get some sort of HDMI-in card to accept the signal from the box.  Do my recordings then get recorded on the DVR or LMCE?

I've settled on Insteon for my home automation protocol but don't know what all I need to get started using insteon with LMCE.  Do I need to get an Insteon starter pack with access points (bridges) or a controller to connect to LMCE?  Or can I simply purchase insteon compatible switches/dimmers and connect the PLC to LMCE via USB?



Also, I have an existing honeywell security system that is currently not monitored by a security company.  How do I connect the security system to LMCE and utilize existing door/window sensors and motion detectors?

As for VOIP, I'm assuming you have to have a telephone line to the PSTN to run Asterisk?  Are there any ways to connect VOIP phones to the PSTN over the internet (aside from Vonage/Joiphone/etc)?  I currently use Google Voice but i know there are limitations and such for connecting to external phone numbers.

Just looking for a little guidance... I know there's a lot here, but I appreciate any guidance you can provide.

sambuca

  • Guru
  • ****
  • Posts: 462
    • View Profile
Re: LMCE newb... what do I need?
« Reply #1 on: September 08, 2011, 07:55:35 am »
A lot of information, but I'll try to give some pointers.

Hybrid/Core/MD. I prefer running a separate Core in a downstairs room, as it is supposed to be on 24/7. You may not want that in your living room. Another factor is whether you want several MDs down the line. That will also point towards a separate core.
Using NAS for storage is by some the prefered way to add storage to a LMCE system.

Also realize that LMCE is designed to be an appliance. That means that by design it requires to be set up with two network interfaces, one external, which should receive DHCP from your network gateway/modem, and an internal interface, which provides DHCP to your connected LMCE devices (MDs) and provide PXE(network) booting for MDs. The second point is the most important, but I strongly suggest not deviating from this setup if you're not 100% what you're doing.

I don't know anything about DirectTV, but in general you need some kind of device that captures/interfaces the video signal into your computer. But LMCE can also control a separate set-top-box if you are unable to do it other ways. LMCE uses MythTV or VDR as a DVR/PVR, and if you interface the video signal into LMCE, LMCE will record and play back those recording.

For home automation, you will also need some sort of interface to connect to your home automation network. Most such interfaces are USB-connected. I think there are some information about such thing in the wiki, look at the Home Automation category.

Security system. Connecting it to LMCE depends on what connections are available on the system. Most use RS232, but I don't know your particular system. You should check if LMCE supports your particular model too, check the wiki.

For VOIP, you need either a VOIP provider that allows you to connect your own Asterisk installation, or you need a ATA-adapter, which you plug in between your PSTN phone line and Asterisk. The SPA-3102 is an example of a adapter. The wiki also has information about this kind of setup.

Hope this helps.

br
sambuca

timpj5

  • Making baby steps
  • Posts: 3
    • View Profile
Re: LMCE newb... what do I need?
« Reply #2 on: September 08, 2011, 03:10:06 pm »
Sambuca,

thanks for the info...

I currently already have a DHCP server from my Untangled router... is DHCP/PXE required for MDs?  If so, I know it's possible to PXE boot from a media server (separate from DHCP server) but I haven't done DHCP/PXE in a while since I am no longer in desktop support.  My HTPC is currently on just about 24/7 anyways, but my servers are for sure.  Does the core function well as a VM?

As for DirecTV, I was planning on utilizing my current set-top-box to interface with LMCE... so I essentially need a capture card for that?

Again, thanks for your help...

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3675
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: LMCE newb... what do I need?
« Reply #3 on: September 08, 2011, 04:39:34 pm »
you are free to use your own DHCP and tftp server. Doing it the way LinuxMCE has been doing it (having both on the core) give you the advantage does everything works automatically.

mkbrown69

  • Guru
  • ****
  • Posts: 213
    • View Profile
Re: LMCE newb... what do I need?
« Reply #4 on: September 08, 2011, 07:04:16 pm »
I have a 20-bay chassis with (10) 1TB drives in 2 RAID sets with a global hotspare for a total of 7TB of usable storage running FreeNAS.

I run a 2-node vSphere cluster with twin IBM xSeries 3500's connected via iSCSI from FreeNAS, each with 8GB of RAM.  I've been thinking about cutting my cluster down to a single node and either using the other one for a core server or getting rid of it altogether (it's very loud and consumes alot of power).

I also run a decent Dell PC as an Untangled router...

All of this is connected to a 48-port managed gig switch capable of VLAN tagging (which currently separates my storage network from my internet accessible network, as well as my ESXi management networks... routed via router on a stick with a Cisco 2651XM router)

If you're looking to shrink down your infrastructure, you might want to check out http://www.napp-it.org/napp-it/all-in-one/index_en.html, and specifically the PDF http://www.napp-it.org/doc/downloads/all-in-one.pdf.  Basically, an ESXi host running a Solaris-based NAS/SAN appliance.  You can use RDM, or if your hardware supports VT-d or IOMMU, you can pass through the HBA into the guest.  Assuming you're running ZFS, you may even be able to export your ZFS pools from FreeNAS, and import them to the Solaris-based products.  You definitely can not do vMotion if you go the All-in-one approach, or if you do any PCI pass-through of Tuner cards or other host-based devices.

LMCE runs fine as a VM, as I'm running it as a KVM VM on my Linux virtualisation host.  I'm going to play with a virtual MD for some testing and infrastructure work I'm looking at doing.  I've got an Athlon x2 5050e 2.6Ghz dual core running 6 VM's on 6GB of memory, and my load averages are 0.5 -1.5 the majority of the time (all Linux VM's).  I'll have to bump it up CPU wise if I implement the Win7 Virtual Hosted Desktop I'm thinking of doing... (I like having my own private cloud).

I have two physical NIC's, as recommended by the LMCE configuration architecture.  eth0 is the existing home "production" network, and eth1 is the LMCE managed network.  I've bridged them internally, eth0 to br_ext, and eth1 to br_int, and I have VM's configured to attach to the appropriate network (think vSwitched internal networks bridged to external physical networks).  My mail server VM, Misterhouse VM, and host-based DNS/DHCP/NFS/tftp/MythTV services are connected to the br_ext network, for my existing prod environment, and the LMCE dcerouter/core is dual-homed for external access, but it owns the br_int network.  You could implement something similar using vSwitches and partition your switch or use VLAN tagging to separate the network environments.  It's best to let LMCE manage DNS and DHCP for the LMCE network (the 192.168.80.0/24 net), so that the PnP and auto-configuration stuff works automagically.  If you want to get really fancy, your WAN connection could connect to the Untangle box running as a VM by a physical NIC, have a second virtual interface connected to a vSwitch, which your internal environment gets fed from.  I'll have to start a user page with a picture to show my network architecture... I have a few friends looking to do the same...

I've settled on Insteon for my home automation protocol but don't know what all I need to get started using insteon with LMCE.  Do I need to get an Insteon starter pack with access points (bridges) or a controller to connect to LMCE?  Or can I simply purchase insteon compatible switches/dimmers and connect the PLC to LMCE via USB?

I'm running Insteon at home myself, under Misterhouse presently.  There are some GSD drivers in LMCE, but I haven't been able to get them to work reliably with my setup.  Someone is working on proper C++ drivers with support for Insteon Groups, scenes, and Link management, so I'll try again when those drivers are ready.  You'll need a PLM (USB or Serial) to attach to the computer, and you can use dual-band devices on different legs or phases to bridge the Insteon signals between your A and B legs (rather than Access Points).  The USB PLM merely has a FTDI Serial to USB chip built in, so it'll show up as a serial port on /dev/ttyUSBx.  It's important to get a good quality Insteon network going first; there are lots of "signal suckers" for Insteon/X10 PLC signals (like UPS's, PC Power Supplies, phone chargers, etc).  You'll likely need to put those on signal filters to improve the reliability of the Insteon network.  Dual-band devices are also useful for network integrity; at minimum, you'll need two, but they can be helpful on more problematic circuits, so more than two won't be a waste.  Four seems to be a common number.  If you have Arc-Fault circuit breakers, Insteon PLC signals won't pass through the breaker, so dual-band devices are useful for bridging the comms from the rest of the house onto the arc-fault protected circuit.

Hope that helps!

/Mike

tkmedia

  • wants to work for LinuxMCE
  • **
  • Posts: 937
    • View Profile
    • LMCECompatible
Re: LMCE newb... what do I need?
« Reply #5 on: September 08, 2011, 08:39:35 pm »
I have found vm's work fine for testing for both core and MD's but as far as a production system It don't cut the mustard.

as far as insteon goes ... lmce currently has better support for zwave.
Do you guys have stock in your electric companies ;)
You can run lmce on a 35 watt core

just my 2cents

Tim
My Setup http://wiki.linuxmce.org/index.php/User:Tkmedia

For LinuxMce compatible  systems and accessories
http://lmcecompatible.com/

mkbrown69

  • Guru
  • ****
  • Posts: 213
    • View Profile
Re: LMCE newb... what do I need?
« Reply #6 on: September 08, 2011, 09:46:25 pm »
I have found vm's work fine for testing for both core and MD's but as far as a production system It don't cut the mustard.

Do you guys have stock in your electric companies ;)
You can run lmce on a 35 watt core

just my 2cents

Tim

In my day job, 95% percent of what I work on is virtualized, and I work with 4 different hypervisors on three different hardware platforms.  The stuff that doesn't get virtualized is the stuff that will keep a 32-core box running flat out all the time on it's own. VM's run fine when the OS is tweaked to use paravirtualized drivers and some of the default behaviours of it's I/O are changed.  It's also helpful to have an end-to-end understanding of the hosting hardware platform, the hypervisor and it's various schedulers, and the underlying infrastructure like SAN and network, plus where you need to tweak under the hood to optimize for the workload.  At work we regularly get 80-100 VM's onto a big honkin server, and the client's don't know the OS instance is virtualized.

As for my home system, I'm running LMCE plus an average of 5 other VM's on a 45W Dual core CPU.  LMCE (8.10) actually places the highest load on the system, in part do the the age of the virtualized drivers and the kernel itself, plus inefficiencies in ext3 filesystems running in virtuals.  10.04 with ext4 file systems and VirtIO drivers plays a lot nicer in a virtualized environment.  I'm actually trying to avoid having to upgrade the CPU, but if I end up running Windows as a virtual I'll have no choice; Windows (even 7) takes up wayyyy more resources than an equivalent Linux install.  Energy efficient CPU's in Socket AM3 are getting harder to find unless you special order them from NewEgg or something like that...

LMCE Core (1vCPU, 1.7G RAM)
Zarafa Mail Server (1vCPU 1.5G RAM)
Misterhouse Home Automation (1vCPU 512M RAM)
Astaro VPN endpoint (1vCPU 512M RAM)
Ubuntu Virtual Hosted Desktop (1vCPU 784M RAM)
LMCE MD and other test VM's (1 vCPU and various RAM sizes, keeping under 5G total to leave a gig for the host OS)

Plus MythTV and other external network services that are running on the host OS.

At this point in time, I'm more I/O bound than CPU bound, but less so since I added a 40G SSD which I've carved up through LVM and presented as separate disks to instances running MySQL.  It gets mounted inside the guest at /var/lib/mysql, and the db files sit on it.  I'm seeing ~1400 IOPS using the VirtIO drivers in the guest to the LVM'd SSD, compared to ~100 IOPS on my RAID-1 set on the host, using the Oracle Orion test tool.  Disks are better for sequential I/O (like media files and logging), and SSD's are better for Random I/O (like OS drives and databases).  Using Orion on the raw SSD block device from the host nets me ~25K IOPS (that's avoiding the FS and the FS cache).

One thing that tends to foul up most people using VM's is throwing more vCPU's at an instance in order to improve performance.  More often than not, more vCPU's will hobble you, as the hypervisor has to find the free number of cores available at the same time as you have vCPU's configured, before it will schedule workload on the cores.  So, on a dual core host, a VM with 2 vCPU's would need both cores free _at the same time_ before the hypervisor's scheduler will dispatch the guest onto the cores.  So, host processes will be in competition with the guest for CPU time, as those usually get dispatched individually onto cores.  If you have more than one 2vCPU guest, then they start to get into contention for CPU time, with each other and the other guests.  If they have heavy I/O, then the host is competing with the guests for CPU time in order to perform the I/O, and all are starved out as a result.  Then people complain that virtualization sucks...  ;)

Food for thought...

/Mike
« Last Edit: September 08, 2011, 10:07:15 pm by mkbrown69 »

timpj5

  • Making baby steps
  • Posts: 3
    • View Profile
Re: LMCE newb... what do I need?
« Reply #7 on: September 09, 2011, 04:41:53 am »
Mike,

Thanks for your suggestions...

Frankly, I'm not necessarily trying to scale down (although it would help my electric bill if I did) my day job consists of designing and implementing vSphere environments and since my previous company didn't have a lab or lab gear, I built my own so that I could do testing/troubleshooting.  So that's my reason for having an ESXi cluster... and I used to use OpenFiler but when I purchased my new hardware, I could not get OpenFiler to run without kernel panics... so I switched to FreeNAS.

I originally tried to run my Untangle router as a VM from a private routed network, but the performance was not good... it slowed down my internet access significantly.  I essentially run 2 domain controllers, a windows file server, vCenter server and a couple of admin desktops.  With that, my memory utilization is around 70% on each host so I don't have much headroom from that aspect.  So because my new employer has a lab I no longer need lab gear in my home and I really don't use my domain for anything allowing me to repurpose at least one of my esxi hosts.

I looked at zwave but I've heard good/bad about it.  I've heard that Insteon is more stable than zwave which is why I settled on it.  I don't really care which I use, just as long as it works reliably.  Suggestions would be appreciated.


hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: LMCE newb... what do I need?
« Reply #8 on: September 09, 2011, 10:10:45 am »
I'm running the core as guest in KVM. USB passthrough for the z-wave dongle. Works fine.

br Hari
rock your home - http://www.agocontrol.com home automation

tkmedia

  • wants to work for LinuxMCE
  • **
  • Posts: 937
    • View Profile
    • LMCECompatible
Re: LMCE newb... what do I need?
« Reply #9 on: September 09, 2011, 05:03:05 pm »
I am sure my vm's are not fully optimized.... Thanks for the hints  I  have run my system for several months with as many as 7 md's  from a virtual core.   Other than the rare drop of my USB passthrough and  long screen regens it worked pretty well. The main reason I dropped It from VM was Voip was very choppy.   There probably is a tweak for that. But the need for reliable voip won out.  I haven't tried lately but plan to once the voip is working for 1004.

Mike,
Thanks
any good docs you could point us to.
Currently I am running KVM on a proxmox ve server
I do have an 80gb ssd I could add for mysql use any hints on that

Tim
My Setup http://wiki.linuxmce.org/index.php/User:Tkmedia

For LinuxMce compatible  systems and accessories
http://lmcecompatible.com/

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: LMCE newb... what do I need?
« Reply #10 on: September 09, 2011, 06:34:56 pm »
Just to add my 10c worth to this little 'hardware' v's 'Virtual Hardware' fest;

My home Core is currently built around a dual-core Atom 330 motherboard with 2gig of RAM and a 160gig boot drive - the whole core draws 22w peak and averages about 16w. I have a 4tb Linksys NAS for all my media storage... that draws about 12w. The system serves 4 audio/video zones and at peak on a Sat evening manages to record 12 concurrent DVB-T recordings while streaming a DVD or BluRay rip or two. We dont's use lighting or Voip but we could do so within the capacity of the Core. Adding IP Cams would be the only thing that I would think twice about with this Core... they stress a Core quite heavily if motion is enabled.

Hope the above helps.

Andy

Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

mkbrown69

  • Guru
  • ****
  • Posts: 213
    • View Profile
Re: LMCE newb... what do I need?
« Reply #11 on: September 09, 2011, 06:44:03 pm »
any good docs you could point us to.
Currently I am running KVM on a proxmox ve server
I do have an 80gb ssd I could add for mysql use any hints on that

Tim,

I think I'll write up a wiki page of tips and tricks for virtualization that are specific to LMCE, so it doesn't get lost in this thread.  Mostly, it's paying attention to a whole bunch of little details, where the aggregate cause a significant performance boost.

Proxmox VE is a Debian-based distro, with KVM and their own perl-based management GUI.  I haven't used it myself other than quickly trying it out, but I believe it uses LVM as an option with local storage.  If that's the case, then what you might want to do is carve off a 20G LVM slice of the SSD as your LMCE boot/root disk, and mount other spindle-based slices as /var/log, /tmp and /home.  That way, you're placing your I/O workload onto hardware that will lend itself well to the types of I/O that will be hitting it.  I think you'll find Orbiter Regens will just fly!  It'll take some work to do it that way; you'll either have to install from scratch to the SSD, doing a manual partitioning of the virtual disks, or restore a clonezilla backup to the SSD, mount the spindle slices to temporary mount points and rsync the data over (and then delete the original copy), then pivot the disks into their final mount points.  There are some SSD specific optimizations that can be done in the guest OS, plus the disk I/O schedulers need to be disabled for the virtual disks.

Basically, the kernel disk drivers assume that it's writing to real disks, so it queues up and re-orders operations in order to take advantage of where the heads are over the disk platters.  The host OS is already doing this, so we don't need the guest OS doing it also, because it will simply be working at odds to what the host (who actually controls the access to the disks) is doing.  So, we add "elevator=noop" to the kernel boot parameters of the guest.  Where to do it varies between grub and grub2, so I'll leave that as an exercise for the wiki.  You can change it on the fly with echo noop > /sys/block/[s,v]d[a-z]/queue/scheduler.  You can also cat that file to see the one in brackets that is presently selected.  You can do that change on a per-disk basis in /etc/rc.local, by echoing the appropriate scheduler to the appropriate disk.  SSD's like the deadline scheduler better, as it round-robins all the processes seeking I/O time.

You also want to configure the device on the virtualisation host as a "Virtual disk" rather than an emulated IDE or SCSI, as that will leverage the paravirtualized VirtIO drivers.  You'll also want to configure the network adapter as a VirtIO device as well, as the drivers for both network and disk are included in the 8.10 and 10.04 kernels.  VirtIO gives a huge performance boost (near native, 95~99% to the physical hardware), as the hypervisor is not having to emulate various hardware registers in software.  Networking between VM's using VirtIO is simply a memory-to-memory copy, and that occurs at orders of magnitude faster in RAM than on wirespeed.

There are some other parameters I've put in my libvirt config files to disable caching, mount point options in the guest OS's to optimize for the underlying slices, and some other application specific tweaks, so I'll go through my stuff at home and make a proper wiki page for a virtual LMCE core.  I've got some half baked ideas for  some infrastructure work on LMCE that will do some auto-detection of the underlying core and md hardware (physical and virtual), and will make optimizations based on what it finds.  It's something I'm already working on at the day job, so I'll need to work up a proof-of-concept at home for how I can abuse it for use in LMCE.  It's going to take a while to get there, as I have to poke around under the hood in LMCE to see how things are working presently, and how (and when) this new infrastructure could be integrated non-disruptively.

Hope that helps!

/Mike