Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

VMware vCLI 설치

  • vCLI 설치전 필수 소프트웨어 설치설치합니다.

Code Block
$ yum install e2fsprogs-devel libuuid-devel openssl-devel perl-devel
$ yum install glibc.i686 zlib.i686
$ yum install perl-XML-LibXML libncurses.so.5 perl-Crypt-SSLeay
$ yum -y install perl-Socket6
$ yum -y install cpan
$ yum -y install gcc-c++
$ PERL_MM_USE_DEFAULT=1 cpan install BINGOS/ExtUtils-MakeMaker-6.96.tar.gz LEONT/Module-Build-0.4205.tar.gz JRM/UUID-0.28.tar.gz ESAYM/Time-Piece-1.3401.tar.gz  PERIGRIN/XML-NamespaceSupport-1.12.tar.gz  SHLOMIF/IO-Socket-INET6-2.72.tar.gz
  • vCLI Package 설치

1 단계 : vCLI 설치 Package 다운로드다운로드합니다.

Info

Download URL : https://code.vmware.com/web/tool/6.7/vsphere-cli

2 단계 : root 로 로그인로그인합니다.

3 단계 : 다운로드한 vCLI 압축 해제해제합니다.

Code Block
languagebash
$ tar zxvf <file-path>/VMware-vSphere-CLI-6.7.0-8156551.x86_64.tar.gz -C <file-path>

4 단계 : 설치프로그램 실행

Code Block
languagebash
$ sudo <file-path>/vmware-vsphere-cli-distrib/vmware-install.pl

...

7 단계 : vCLI 설치 확인

Code Block
languagebash
$ esxcli -s <vCenter Server or ESXi host> -u <username> -p <password> -h <host-location> system syslog config get
Note

위 명령어를 입력하면 Certificate error. 와 함께 thumbprint : xx:xx:xx:xx:xx … 가 출력되면 아래와 같이 thumbprint를 credstore에 추가함

  • thumbprint 추가

Code Block
languagebash
$ /usr/lib/vmware-vcli/apps/general/credstore_admin.pl add --server <host-location> --thumbprint <thumbprint>

...

  • init.py Source의 def ignores_kwargs 수정

Warning

Salt Version 3001.1 이상 버전일 경우 불필요

Code Block
$ vim /usr/lib/python3.6/site-packages/salt/utils/decorators/init.py
def ignores_kwargs(*kwarg_names):
    '''
    Decorator to filter out unexpected keyword arguments from the call
    kwarg_names:
        List of argument names to ignore
    '''
    #print(kwarg_names)
    def _ignores_kwargs(fn):
        @wraps(fn)
        def __ignores_kwargs(*args, **kwargs):
            log.trace(f'args: {args}')
            log.trace(f'kwargs: {kwargs}')
            if args:
                ret_fn = fn(*args)
            else:
                kwargs_filtered = kwargs['__pub_arg'][0].copy()
                log.trace(f'Before kwargs_filtered 1: {kwargs_filtered}')
                for name in kwarg_names:
                    log.trace(name)
                    if name in kwargs_filtered:
                        del kwargs_filtered[name]
                    log.trace(f'After kwargs_filtered: {kwargs_filtered}')
                ret_fn = fn(**kwargs_filtered)
            return ret_fn
        return __ignores_kwargs
    return _ignores_kwargs

...

Code Block
languagepy
@depends(HAS_PYVMOMI)
@ignores_kwargs('credstore')
def get_ticket(host, username, password, protocol=None, port=None):
    service_instance = salt.utils.vmware.get_service_instance(host=host,
                                                              username=username,
                                                              password=password,
                                                              protocol=protocol,
                                                              port=port)                                                              
        
    content = service_instance.RetrieveContent()
    
    session_manager = content.sessionManager
    sessionTicket = session_manager.AcquireCloneTicket()
    
    return sessionTicket

CloudHub addon argument 추가

...

  • VMware Tab on/off optionable 처리합니다.

  • CloudHub server 실행시 argument에 Add-on

...

  • 옵션 추가한다.

Code Block
languagebash
# CloudHub server option
# -u=vsphere:on 추가
#
$ cd /etc/default
$ cat cloudhub
CLOUDHUB_OPTS="-l=debug \
.......
-u=vsphere:on \
......."

VMware 탭 show/hide

  • Infrastructure에서 조회된 Host의 Application에 vSphere 가 존재하는지 여부 확인합니다.

  • User Role : admin 이상