heal instance info cache interval

리눅스/OpenStack|2017. 9. 25. 13:38
반응형

1분단위로 인스턴스 네트워크 상태체크 

# tail -f /var/log/neutron/neutron-server.log 

2017-09-25 10:19:53.822 24829 INFO neutron.wsgi [req-448162bd-dc52-45d1-b2c7-8bb9fe59bb1f 1c3b76bac514414ba0c7ac2233b5ebea 5440c3eab4604978b676ffe6f748a96e - - -] 172.16.217.31 - - [25/Sep/2017 10:19:53] "GET /v2.0/ports.json?tenant_id=12c23eb3174d44e391389c0e69e2a4b8&device_id=3591e5e8-cc80-4e7f-a49f-e915e86faf95 HTTP/1.1" 200 1073 3.262539

2017-09-25 10:19:54.136 24829 INFO neutron.wsgi [req-f3316317-df05-4b2f-b4bb-8598d82ba894 1c3b76bac514414ba0c7ac2233b5ebea 5440c3eab4604978b676ffe6f748a96e - - -] 172.16.217.31 - - [25/Sep/2017 10:19:54] "GET /v2.0/networks.json?id=9a6bafb9-aae2-46b8-b72c-26abd4ea41ec HTTP/1.1" 200 857 0.309153

2017-09-25 10:19:54.400 24829 INFO neutron.wsgi [req-494bde0e-8b4e-4466-877a-49c616c276a7 1c3b76bac514414ba0c7ac2233b5ebea 5440c3eab4604978b676ffe6f748a96e - - -] 172.16.217.31 - - [25/Sep/2017 10:19:54] "GET /v2.0/floatingips.json?fixed_ip_address=172.16.0.13&port_id=ef99e958-676d-420f-8715-98040783e659 HTTP/1.1" 200 609 0.260283

2017-09-25 10:19:54.737 24829 INFO neutron.wsgi [req-007a921b-385e-4fd5-80fb-51288acce0ee 1c3b76bac514414ba0c7ac2233b5ebea 5440c3eab4604978b676ffe6f748a96e - - -] 172.16.217.31 - - [25/Sep/2017 10:19:54] "GET /v2.0/subnets.json?id=67bbebe9-0ce3-4b49-b36b-43495101763d HTTP/1.1" 200 785 0.332609

2017-09-25 10:19:58.015 24829 INFO neutron.wsgi [req-9299fcb2-9323-4cdf-bf5f-20db2a4a1000 1c3b76bac514414ba0c7ac2233b5ebea 5440c3eab4604978b676ffe6f748a96e - - -] 172.16.217.31 - - [25/Sep/2017 10:19:58] "GET /v2.0/ports.json?network_id=9a6bafb9-aae2-46b8-b72c-26abd4ea41ec&device_owner=network%3Adhcp HTTP/1.1" 200 1076 3.274809



기본 interval 수정 (60 --> 120)

ComputeNode

# vim /usr/lib/python2.7/dist-packages/nova/compute/manager.py

165     cfg.IntOpt("heal_instance_info_cache_interval",

166                default=120,



# cp /usr/lib/python2.7/dist-packages/nova/compute/manager.py /usr/lib/python2.7/dist-packages/nova/compute/manager.py_20170925

# sed -i "166s/default=60/default=120/g" /usr/lib/python2.7/dist-packages/nova/compute/manager.py

# /etc/init.d/nova-compute restart 



[출처] https://chonnom.com/bbs/board.php?bo_table=OpenStack&wr_id=544&page=0&sca=&sfl=wr_subject%7C%7Cwr_content&stx=&sst=&sod=&spt=0&page=0

반응형

댓글()

aggregate 에서 컴퓨트 노드 추가, 제거하기

리눅스/OpenStack|2017. 9. 20. 14:41
반응형

# nova aggregate-list 

+----+----------------------+-------------------+ 

| Id | Name                 | Availability Zone | 

+----+----------------------+-------------------+ 

| 1  | share-zone1          | vCore             | 

| 3  | nonshare-zone1       | rCore             | 

| 4  | nonshare-8core-zone1 | rCore-8           | 

| 5  | sysdocu-group            | sysdocu               |

+----+----------------------+-------------------+ 


예제에서 nonshare 는 rCore 를 말합니다.

현재는 share, rCore, rCore(8core전용) 세 그룹이 있습니다.

각 그룹마다 어떤 컴퓨트 노드들이 포함되어있는지 확인하는 명령은 아래와 같습니다.


# nova aggregate-details 5    // ID 값 5번 (sysdocu) 에 포함된 리스트 출력


이제 아래와 같이 sysdocu 그룹에서 컴퓨트 노드를 빼고 rCore 그룹에 hl-217-50 컴퓨트 노드를 추가합니다.


# nova aggregate-remove-host 5 hl-217-50


# nova aggregate-add-host 3 hl-217-50


rCore 그룹에 포함되었으며 개통 가능한 상태인지 확인하는 방법은 아래와 같습니다.


# nova service-list |grep hl-217-50

| 216 | nova-compute     | hl-217-50  | rCore      | disabled  | up    | 2017-09-20T05:39:42.000000 | -               |


# nova service-enable hl-217-50 nova-compute    // 활성화 시키기

# nova service-disable hl-217-50 nova-compute    // 비활성화 시키기

반응형

댓글()

컴퓨트 노드 변경 (마이그레이션 migration) 하기

리눅스/OpenStack|2017. 9. 20. 14:37
반응형

VM 을 다른 컴퓨트 노드로 옮기는 방법입니다.


1. VM 이 위치한 컴퓨트 노드와 flavor 확인

# nova show cb8aa272-736d-43f4-abf0-596da4664234 |grep -E 'hyper|flavor'

| OS-EXT-SRV-ATTR:hypervisor_hostname  | hl-217-50                                                  |

| flavor                               | rCore.P1 (95d11601-728d-43b5-804d-4612673a30eb)            |


2. flavor 변경 (resize)

# nova resize cb8aa272-736d-43f4-abf0-596da4664234 vCore.V1


* 참고 flavor list 보기

# nova flavor-list


3. 확인

# nova show cb8aa272-736d-43f4-abf0-596da4664234 |grep -E 'hyper|flavor'

| OS-EXT-SRV-ATTR:hypervisor_hostname  | hl-217-51                                                  |

| flavor                               | vCore.V1 (e4b1a4be-9f72-42ce-b1d3-67e4546ad450)            |


조금 기다리면 컴퓨트 노드와 flavor 가 바뀐것이 확인 됩니다.

혹시 flavor 만 변경되고 컴퓨트 노드가 변경 안된다면 아래와 같은 명령으로 대체해서 테스트가 가능합니다.


(참고)

# nova migrate  cb8aa272-736d-43f4-abf0-596da4664234    // 껐다 이동후 켜기

# nova live-migration  cb8aa272-736d-43f4-abf0-596da4664234 hl-217-51    // 운영중 이동 & 컴퓨트 노드 지정


nova live-migration 이 안될 경우

nova live-migration --block-migrate 옵션을 추가하여 실행하면 됩니다.

그리고 잘 실행이 됐는지 nova show [VM ID] |grep status 로 확인해봅니다.

반응형

댓글()

mysql 테이블 생성 예제

리눅스/MySQL|2017. 9. 1. 15:31
반응형

create table test (id int(3) AUTO_INCREMENT PRIMARY KEY, name varchar(20), age int(3));

insert test (name, age) values ('CDH', '20');

insert test (name, age) values ('JJE', '21');

반응형

댓글()

clamav 안티 바이러스, 악성코드 프로그램 설치 & 우분투 PC 적용

리눅스/Security|2017. 8. 11. 09:02
반응형

1. 설치


# yum install clamav clamd


* 바이러스 감염 파일이 필요한 경우 clamav-testfiles 패키지도 같이 설치해줍니다.

   파일 경로는 /usr/share/clamav-testfiles/ 입니다.


설치가 되지 않을 경우 epel-release 를 먼저 설치해줍니다.


# yum install epel-release



2. DB 업데이트


최신 DB 를 업데이트 합니다.


# freshclam


DB 다운로드 사이트에 접속이 잘 안되므로 업데이트가 되지 않을 경우 명령을 몇 번 더 재실행 해봅니다.



3. 검사


실시간으로 검사하지는 않으므로 cron 등을 이용해 주기적으로 로그를 남기도록 하는것이 좋습니다.


1) 특정 디렉토리 검사


# clamscan -r /디렉토리명


* 명령 실행 후 멈춘 것 같은 현상이 나타나는데, 실제 스캔을 시작하기까지 어느 정도의 시간이 소요됩니다.

   파일 개수나 용량이 적은 디렉토리의 경우도 동일합니다. 기다려보세요~!


2) 로그 생성


# clamscan -r /디렉토리명 -l scan.log



※ 팁


# service clamd start 이후


# clamdscan -r /디렉토리명 과 같이 구동하면 스캐닝 시간이 단축 됩니다.


항상 데몬형태로 떠있으며 엔진을 알아서 받아와서 적용하기때문에 clamscan 할때마다

엔진 버전 체크하는 시간이 줄어들어서 그런것으로 알고 있습니다.



※ 우분투 PC


우분투 PC 에 실제로 적용한 사례를 기술하였습니다. 필요하신 분은 내용을 참고하여 환경에 맞게 수정해 사용하시기 바랍니다.


(root 계정에서)


# apt -y install inotify-tools asciidoctor


# mkdir scan_result


# vi scan.sh


#!/bin/bash


find /root/scan_result/ -ctime +30 -exec rm -f {} \;

date=`date +%Y%m%d`

clamscan -r / -l /root/scan_result/${date}.log

cut_from=`cat -n /root/scan_result/${date}.log |grep "SCAN SUMMARY" |tail -n 1 |awk {'print $1'}`

cut_to=`cat -n /root/scan_result/${date}.log |tail -n 1 |awk {'print $1'}`


echo $date > /home/sysdocu/scan_result.txt

sed -n "${cut_from},${cut_to}p" /root/scan_result/${date}.log >> /home/sysdocu/scan_result.txt


# vi /etc/crontab


00 9    * * *   root    sh /root/scan.sh    # 추가 


clamav 를 매일 아침 9시에 root 권한으로 실행하도록 하였습니다.



(sysdocu 계정에서)


스캐닝이 완료되면 브라우저를 통해 결과를 띄우도록 합니다.


$ touch scan_result.txt


$ vi scan_result.sh


#!/bin/bash


while :

do


    # 파일 변화 감지

    inotifywait -qm --event modify --format '%w' scan_result.txt | asciidoctor scan_result.txt


    # 파일 생성 대기

    sleep 10


    # 결과가 있는 경우

    LINE=`cat scan_result.txt |grep "SCAN SUMMARY" |wc -l`

    if [ "$LINE" == "1" ]; then

        # chrome 으로 결과를 확인 할 경우

        sudo -u sysdocu /opt/google/chrome/chrome "scan_result.txt" &

        # gedit 로 결과를 확인 할 경우

        #sudo -u sysdocu gedit "scan_result.txt" &

    fi


    # 브라우저 뜰 때까지 내용 초기화 대기

    sleep 10


    # 내용 초기화

    cat /dev/null > scan_result.txt


    # 만약을 위해 10분 대기

    sleep 600


done


* 자칫 잘못하면 inotifywait 에서 기다리지 않고 넘어가면 작업이 불가능할 정도로 크롬 브라우저 창이 계속 생성될 수 있으므로 안전하게 sleep 600 을 꼭 주도록 합니다.


PC 부팅시 실행되도록 하고, 현재 세션에서도 실행을 한 번 해줍니다.


$ echo "bash /home/sysdocu/scan_result.sh &" >> /home/sysdocu/.profile


$ bash /home/sysdocu/scan_result.sh &


반응형

댓글()

네트워크 장치명 변경 (Ubuntu 16.04)

리눅스/Network|2017. 8. 8. 17:26
반응형

네트웍 장치명이 enp2s0, enp4s0 으로 잡혀있을때 eth0, eth1 변경 방법



1. 파일 수정


[root@sysdocu ~]# vi /etc/default/grub


GRUB_CMDLINE_LINUX="net.ifnames=0"  // 옵션 수정



2. 명령어 실행


[root@sysdocu ~]# update-grub



3. 네트워크 설정 변경


[root@sysdocu ~]# vi /etc/network/interfaces


원하는 장치명으로 변경

- enp2s0 -> eth0

- enp4s0 -> eth1



4. 파일 생성


[root@sysdocu ~]# ip link


ip link 결과값을 확인합니다.

결과값을 토대로 아래 파일을 생성해줍니다. (맥어드레스와 사용할 장치명을 적절히 입력)


[root@sysdocu ~]# vi /etc/udev/rules.d/70-persistent-net.rules


SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="6c:b3:11:3b:68:d1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="1c:1b:0d:33:fb:79", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"



* 커널에 문제가 있어 리부팅 후 네트웍이 정상적으로 잡히지 않을 경우 KERNEL=="eth*", 옵션을 빼주면 됩니다.

* 부팅후 ip link 명령어로 네트워크 장치명 확인시 rename2 등과 같은 문제가 발생할 경우 네트워크 장치와 70-persistent-net.rules 파일의 룰 설정 개수가 맞지 않기때문일 수 있습니다. 이 경우 사용하지 않는 네트워크 장치일지라도 70-persistent-net.rules 파일에 설정을 해두면 해결이 됩니다.



5. 리부팅 


반응형

댓글()

이미지 업로드 에러발생시

리눅스/Ceph|2017. 8. 7. 09:51
반응형
원인 : token id 인증유효기간
ImageNotAuthorized: Not authorized for image 9caecc4e-eaf0-48c6-aebe-04581707ff2b.

기본값은 3600초 (1시간)
이미지를 Upload 시점부터 주기적으로 image 상태를 체크하게 되는데 완료된 시점에 처음시점에 발급받은 토큰 유효기간이 지나면서 인증에 오류발생 


# cat /etc/keystone/keystone.conf
..............
[token]
provider = fernet
expiration =9000 
 :: 2시간 30분
 
# service apache2 restart
# date
2017. 08. 01. (화) 11:34:42 KST

# openstack token issue -c expires
+---------+-----------------------------+
| Field   | Value                       |
+---------+-----------------------------+
| expires | 2017-08-01T12:34:50.751559Z |
+---------+-----------------------------+

# service apache2 restart
# openstack token issue -c expires
+---------+-----------------------------+
| Field   | Value                       |
+---------+-----------------------------+
| expires | 2017-08-01T14:05:06.677567Z |
+---------+-----------------------------+



# cat /var/log/cinder/cinder-volume.log
..........................................
2017-07-18 17:40:23.130 24165 INFO cinder.volume.manager [req-ce23ac35-f334-43f0-909a-4b89cd47c5c7 21600390e35444bb989d79b4bc4ca15f 07edea9946d84472b2dfd8214c39bfb0 - - -] Created volume successfully.
2017-07-18 17:40:26.067 24165 INFO cinder.volume.manager [req-05c9cc61-a77f-410e-a481-770ab11659a9 21600390e35444bb989d79b4bc4ca15f 07edea9946d84472b2dfd8214c39bfb0 - - -] Initialize volume connection completed successfully.
2017-07-18 17:40:27.880 24165 INFO cinder.volume.manager [req-7526c5c2-50ea-458e-90b7-3718f6c26bee 21600390e35444bb989d79b4bc4ca15f 07edea9946d84472b2dfd8214c39bfb0 - - -] Attach volume completed successfully.
2017-07-18 17:52:08.341 24165 INFO cinder.image.image_utils [req-067b3d37-01ec-42b7-b178-547670a0c029 0989cabab0124d578b69f1e4aa9a1841 7d5a2d6a87b7425b84a23a673a1a530d - - -] Converted 153600.00 MB image at 83.71 MB/s

2017-07-18 18:58:50.151 24165 ERROR cinder.volume.manager [req-067b3d37-01ec-42b7-b178-547670a0c029 0989cabab0124d578b69f1e4aa9a1841 7d5a2d6a87b7425b84a23a673a1a530d - - -] Upload volume to image encountered an error (image-id: 9caecc4e-eaf0-48c6-aebe-04581707ff2b).
2017-07-18 18:58:53.549 24165 WARNING cinder.volume.manager [req-067b3d37-01ec-42b7-b178-547670a0c029 0989cabab0124d578b69f1e4aa9a1841 7d5a2d6a87b7425b84a23a673a1a530d - - -] Image delete encountered an error.
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager Traceback (most recent call last):
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 1330, in _delete_image
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     image_meta = image_service.show(context, image_id)
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 245, in show
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     _reraise_translated_image_exception(image_id)
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 555, in _reraise_translated_image_exception
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     six.reraise(type(new_exc), new_exc, exc_trace)
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 243, in show
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     image = self._client.call(context, 'get', image_id)
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 177, in call
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     return getattr(controller, method)(*args, **kwargs)
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/glanceclient/v1/images.py", line 132, in get
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     % urlparse.quote(str(image_id)))
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 272, in head
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     return self._request('HEAD', url, **kwargs)
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 267, in _request
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     resp, body_iter = self._handle_response(resp)
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 83, in _handle_response
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager     raise exc.from_response(resp, resp.content)
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager ImageNotAuthorized: Not authorized for image 9caecc4e-eaf0-48c6-aebe-04581707ff2b.
2017-07-18 18:58:53.549 24165 ERROR cinder.volume.manager
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher [req-067b3d37-01ec-42b7-b178-547670a0c029 0989cabab0124d578b69f1e4aa9a1841 7d5a2d6a87b7425b84a23a673a1a530d - - -] Exception during message handling: Not authorized for image 9caecc4e-eaf0-48c6-aebe-04581707ff2b.
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 138, in _dispatch_and_reply
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     incoming.message))
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 185, in _dispatch
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     return self._do_dispatch(endpoint, method, ctxt, args)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 127, in _do_dispatch
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     result = func(ctxt, **new_args)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 1320, in copy_volume_to_image
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     payload['message'] = six.text_type(error)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     self.force_reraise()
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     six.reraise(self.type_, self.value, self.tb)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 1306, in copy_volume_to_image
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     image_service, image_meta)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/volume/drivers/rbd.py", line 961, in copy_volume_to_image
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     image_meta, tmp_file)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/image/image_utils.py", line 414, in upload_volume
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     image_service.update(context, image_id, {}, image_file)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 364, in update
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     _reraise_translated_image_exception(image_id)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 555, in _reraise_translated_image_exception
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     six.reraise(type(new_exc), new_exc, exc_trace)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 362, in update
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     **image_meta)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/cinder/image/glance.py", line 177, in call
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     return getattr(controller, method)(*args, **kwargs)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/glanceclient/v1/images.py", line 365, in update
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     resp, body = self.client.put(url, headers=hdrs, data=image_data)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 281, in put
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     return self._request('PUT', url, **kwargs)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/glanceclient/v1/images.py", line 365, in update
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     resp, body = self.client.put(url, headers=hdrs, data=image_data)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 281, in put
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     return self._request('PUT', url, **kwargs)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 267, in _request
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     resp, body_iter = self._handle_response(resp)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher   File "/usr/lib/python2.7/dist-packages/glanceclient/common/http.py", line 83, in _handle_response
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher     raise exc.from_response(resp, resp.content)
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher ImageNotAuthorized: Not authorized for image 9caecc4e-eaf0-48c6-aebe-04581707ff2b.
2017-07-18 18:58:53.615 24165 ERROR oslo_messaging.rpc.dispatcher



[출처] https://chonnom.com/bbs/board.php?bo_table=OpenStack&wr_id=524

반응형

댓글()

samba 서버 마운트할 때 write-protected 에러

리눅스/OS 일반|2017. 7. 28. 16:24
반응형

[문제]

# mount -t cifs -o username=sysdocu,password='12345678' //192.168.10.2/sysdocu /backup

mount: //192.168.10.2/sysdocu is write-protected, mounting read-only

mount: cannot mount //192.168.10.2/sysdocu read-only



[해결]

# yum -y install cifs-utils






반응형

댓글()

[cifs 마운트 에러] CIFS VFS: Send error in SessSetup = -22

리눅스/OS 일반|2017. 7. 28. 08:26
반응형

OS종류에 따른 프로토콜 버전 문제로 보인다.



삼바 cifs 접속시 아래와 같은 메세지가 출력되며


mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


시스템 로그에는 아래와 같은 형태로 찍혀있다면


[19901.015000] Status code returned 0xc0000002 NT_STATUS_NOT_IMPLEMENTED
[19901.015000] CIFS VFS: Send error in SessSetup = -22
[19901.020000] CIFS VFS: cifs_mount failed w/return code = -22


mount 방법을 아래와 같이 하면 된다.


# mount -t cifs -o username=sysdocu,password=12345678,sec=ntlm //192.168.10.2/sysdocu /backup


반응형

댓글()

블록 스토리지 생성 (ceph) 및 인스턴스에 연결하기

리눅스/OpenStack|2017. 7. 20. 16:38
반응형

볼륨 생성

  1. 다음 단계를 관리자가 아닌 프로젝트로 수행하기 위해 demo credential을 소스로 가져옵니다:

    $ source demo-openrc.sh
    
  2. 1 GB 볼륨을 생성합니다:

    $ cinder create --display-name volume1 1
    +---------------------------------------+--------------------------------------+
    |                Property               |                Value                 |
    +---------------------------------------+--------------------------------------+
    |              attachments              |                  []                  |
    |           availability_zone           |                 nova                 |
    |                bootable               |                false                 |
    |          consistencygroup_id          |                 None                 |
    |               created_at              |      2015-10-12T16:02:29.000000      |
    |              description              |                 None                 |
    |               encrypted               |                False                 |
    |                   id                  | 09e3743e-192a-4ada-b8ee-d35352fa65c4 |
    |                metadata               |                  {}                  |
    |              multiattach              |                False                 |
    |                  name                 |               volume1                |
    |      os-vol-tenant-attr:tenant_id     |   ed0b60bf607743088218b0a533d5943f   |
    |   os-volume-replication:driver_data   |                 None                 |
    | os-volume-replication:extended_status |                 None                 |
    |           replication_status          |               disabled               |
    |                  size                 |                  1                   |
    |              snapshot_id              |                 None                 |
    |              source_volid             |                 None                 |
    |                 status                |               creating               |
    |                user_id                |   58126687cbcc4888bfa9ab73a2256f27   |
    |              volume_type              |                 None                 |
    +---------------------------------------+--------------------------------------+
    
  3. 잠시 후, 볼륨 상태가 creating 에서 available 로 바뀌어야 합니다:

    $ cinder list
    +--------------------------------------+-----------+---------+------+-------------+----------+-------------+-------------+
    |                  ID                  |   Status  |   Name  | Size | Volume Type | Bootable | Multiattach | Attached to |
    +--------------------------------------+-----------+---------+------+-------------+----------+-------------+-------------+
    | 09e3743e-192a-4ada-b8ee-d35352fa65c4 | available | volume1 |  1   |      -      |  false   |    False    |             |
    +--------------------------------------+-----------+---------+------+-------------+----------+-------------+-------------+
    

볼륨을 인스턴스에 연결합니다

  1. 볼륨을 인스턴스에 연결합니다:

    $ nova volume-attach INSTANCE_NAME VOLUME_ID
    

    INSTANCE_NAME 을 인스턴스 이름으로, 그리고 VOLUME_ID 를 연결하고자 하는 볼륨에 대한 ID로 변경합니다.

    예시

    09e3743e-192a-4ada-b8ee-d35352fa65c4 볼륨을 public-instance 인스턴스에 연결합니다:

    $ nova volume-attach public-instance 09e3743e-192a-4ada-b8ee-d35352fa65c4
    +----------+--------------------------------------+
    | Property | Value                                |
    +----------+--------------------------------------+
    | device   | /dev/vdb                             |
    | id       | 158bea89-07db-4ac2-8115-66c0d6a4bb48 |
    | serverId | 181c52ba-aebc-4c32-a97d-2e8e82e4eaaf |
    | volumeId | 09e3743e-192a-4ada-b8ee-d35352fa65c4 |
    +----------+--------------------------------------+
    
  2. 볼륨 목록:

    $ nova volume-list
    +--------------------------------------+-----------+--------------+------+-------------+--------------------------------------+
    | ID                                   | Status    | Display Name | Size | Volume Type | Attached to                          |
    +--------------------------------------+-----------+--------------+------+-------------+--------------------------------------+
    | 09e3743e-192a-4ada-b8ee-d35352fa65c4 | in-use    |              | 1    | -           | 181c52ba-aebc-4c32-a97d-2e8e82e4eaaf |
    +--------------------------------------+-----------+--------------+------+-------------+--------------------------------------+
    
  3. SSH를 사용하여 인스턴스에 액세스하고 /dev/vdb 블럭 스토리지 장치에 대한 볼륨이 있는지를 검증하기 위해 fdisk 명령어를 사용합니다:

     $ sudo fdisk -l
    
     Disk /dev/vda: 1073 MB, 1073741824 bytes
     255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
     Units = sectors of 1 * 512 = 512 bytes
     Sector size (logical/physical): 512 bytes / 512 bytes
     I/O size (minimum/optimal): 512 bytes / 512 bytes
     Disk identifier: 0x00000000
    
        Device Boot      Start         End      Blocks   Id  System
    /dev/vda1   *       16065     2088449     1036192+  83  Linux
    
     Disk /dev/vdb: 1073 MB, 1073741824 bytes
     16 heads, 63 sectors/track, 2080 cylinders, total 2097152 sectors
     Units = sectors of 1 * 512 = 512 bytes
     Sector size (logical/physical): 512 bytes / 512 bytes
     I/O size (minimum/optimal): 512 bytes / 512 bytes
     Disk identifier: 0x00000000
    
     Disk /dev/vdb doesn't contain a valid partition table
    

     
    주석

    장치에 파일 시스템을 생성하고 해당 볼륨을 사용하기 위해 마운트해야 합니다.


[출처] https://docs.openstack.org/liberty/ko_KR/install-guide-rdo/launch-instance-cinder.html


반응형

댓글()

지워진 VM 확인하기

리눅스/OpenStack|2017. 7. 20. 11:07
반응형

(검색하기 쉽게 ID 또는 NAME이 있어야 합니다.


# nova list --a --deleted | grep 8264d5fa-652b-4ae0-b375-cba352d54787
WARNING: Option "--all_tenants" is deprecated; use "--all-tenants"; this option will be removed in novaclient 3.3.0.
| 8264d5fa-652b-4ae0-b375-cba352d54787 | testvm1 | 23cb609941d342bc8c92a881f68cb2f5 | DELETED | - | NOSTATE | |


반응형

댓글()