UPS »ç¿ë °ü·Ã ¹®ÀÇ µå¸³´Ï´Ù.

   Á¶È¸ 5963   Ãßõ 0    

안녕하세요 UPS 관련 궁금증이 있어 문의 드립니다.

 

현재 사용하는것은 hp microserver Gen8에 ESXi 6.0을 쓰고 있구요, 

 

몇번의 정전을 겪어 UPS를 사용하게 되었습니다.

 

제가 구입한 모델은 

 

http://prod.danawa.com/info/?pcode=2016359&cate=1131562

 

입니다.

 

 

http://serverfault.com/questions/462993/vmware-esxi-shutdown-triggered-by-apc-ups-connected-via-usb

 

위 링크에 있는 방법중 

Super question. It is actually possible to do this quite nicely - at least on some setups. I have tried the following recipe on a number of ESXi 5.5 hosts. Basically, the solution goes like this:

  1. Enable SSH access on your ESXi host
  2. Create a Linux VM - I use Ubuntu. You only need a very minimal setup - no GUI or anything.
  3. Connect your APC device via USB to the ESXi host and pass it through to the Linux VM.
    • Make sure that the USB controller you add to the VM matches the actual, physical USB controller the APC device is connected to, i.e. only add an XHCI controller if the physical device is a USB3 device. Mismatches seem to cause odd problems in the Linux USB device driver.
    • If things aren't working out and you see errors like ctrl urb status -62 in dmesg, chances are the physical controller doesn't match the one in your VM. If they do match - well then it's a problem. I have one setup with this sort of problem and no real solution to it.
  4. Install apcupsd on the Linux VM - in Ubuntu, you can do sudo apt-get install apcupsd to install the latest version. The NUT project is also nice but I am a traditionalist.
  5. Install the plink utility by doing sudo apt-get install putty-tools
  6. Connect to your ESXI host by doing plink root@. You can close the connection immediately. The objective is to get the host key saved so plink won't prompt for it again when we run it via a script
  7. Edit /etc/apcupsd/apcupsd.conf and change the items below so they match: UPSNAME < the name you'd like your UPS to have >UPSCABLE usbUPSTYPE usbAlso make sure that /etc/default/apcupsd has ISCONFIGURED=yes
  8. Edit /etc/apcupsd/apccontrol and scroll to the doshutdown case. Make it look like this: doshutdown) echo "UPS ${2} initiated Shutdown Sequence" | ${WALL} # Shut down indirectly by triggering the ESXi host to do the # shutdown via VMWare tools /usr/bin/plink root@< your ESXi host IP > -pw Cde32wsx "/sbin/shutdown.sh && /sbin/poweroff";;
  9. Restart apcupsd using sudo service apcupsd restart and see if things are working by invokingapcaccess. If not, check logs and dmesg
  10. Make sure all VMs that need to shut down nicely in case of a power failure have VMWare Tools installed. Also make sure that they are part of the VM startup/shutdown list (in the vSphere Web Client, go to: vCenter -> -> Manage -> Settings -> VM Startup/Shutdown). Make sure that the shutdown action is to shut down the guest OS.

Once you have these things running, the doshutdown scriptlet from step 8 gets invoked on a power failure. This is turn invokes the shutdown.sh script on the ESXi host, which signals the VMWare Tools package in each VM on your host to do a clean shut down via the guest OS. In my experience, it works better than the PowerChute software from APC.

If you like to monitor things from your VMs, you can setup slave apcupsd instances on them that connect to the master UPS control Linux VM. Your slave apcupsd.conf files should have an entry like this:
UPSTYPE net < your UPS control VM IP >:3551
Entries like UPSCABLE and such do not matter in this case. This works with the Windows version of apcupsd (available here) as well. You can use the included apctray.exe to check out the current status of things.

That pretty much covers it, I think.


이 방법을 사용하여 셋팅했습니다.


/usr/bin/plink root@< your ESXi host IP > -pw Cde32wsx "/sbin/shutdown.sh && /sbin/poweroff"

 

이 부분에서 plink로 명령어가 전달이 안되어 sshpass 로 명령어 전달은 성공했습니다. (아마 제 비번의 특수문자 때문인듯 싶습니다)

 

기본값으로는 전원이 끊어지면 배터리 전원이 5% 이하로 떨어지거나, 배터리 사용 가능 시간이 3분 미만으로 떨어질 때 자동으로 ESXi 가 종료되게 되어 있는것 같습니다.

 

역시 전기 끊어지면 시간이 지나 자동으로 종료되는것까지는 확인했습니다.

 

하지만, gen8이 shutdown 되고 off 상태로 있을때, 전원이 다시 복귀되면 자동으로 부팅되어야 할것 같은데 그렇지 않은것 같습니다.

 

(iLO로 접속하여  server power restore 부분은 항상 켜짐으로 설정했습니다.)

 

 

아마도 UPS 측에서 gen8이 종료된후 전기를 완전히 차단해 주지 않아서 문제가 되는것 같습니다.

 

(gen8 입장에서는 셧다운 후 전기가 끊어진적이 없기 문에 - ups 배터리로 공급중이었고, AC 전원이 들어온다 한들 끊겼다가 들어온게 아니기 문에...로 추측 중입니다)

 

배터리가 바닥나면 전기가 차단되고, 이후에 전기가 다시 들어오면 서버가 켜질것 같긴 한데요, 

 

제가 궁금한것은, 

 

gen8이 셧다운 되는 중이거나, 셧다운 완료후 전기가 다시 돌아왔을때, UPS 측에서 gen8로 전기를 완전히 끊어주지 않으면, 이후 전기가 들어와도 서버가 자동으로 켜지지 않는 상태로 남아 있을것 같습니다.

 

제가 방금 테스트 짧게 했을때도 역시 그렇구요.

 

 

 

이 상황에서, gen8 서버가 꺼지면, UPS 측에서 전기를 완전히 끊어주는 방법은 없을까요?

ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.


QnA
Á¦¸ñPage 2495/5590
2015-12   1036717   ¹é¸Þ°¡
2014-05   4484295   Á¤ÀºÁØ1
2015-11   9427   À©µµ¿ì10
2015-11   4057   öÀÌ´Ô
2015-11   3255   FreeBSD
2015-11   4434   ÆÇÅ׶ó¿ÂÁÖ¡¦
2015-11   3421   jack33
2015-11   3454   ¾Æ¸£ÄÚ
2015-11   3022   ½Öcpu
2015-11   3571   À©µµ¿ì10
2015-11   3605   ÀÍ¸í¼º
2015-11   10736   ´ëÇѹα¹
2015-11   5550   inquisitive
2015-11   4534   À̹®¿µ
2015-11   4054   À嵿°Ç2014
2015-11   3468   °ú°ÅÁö»ç
2015-11   7617   ³ª¿ì¸¶Å©
2015-11   4955   À̼±È£
2015-11   4230   ¸ÚÁø³²ÀÚ
2015-11   15167   °Ü¿ï³ª¹«
2015-11   3684   »ßÁüingTM
2015-11   4455   ½É¿ì