Skip to content

Fix: Cannot import Vmware instances - #6384

Merged
nvazquez merged 1 commit into
apache:mainfrom
shapeblue:fiximportinstancesvmwaregub
May 13, 2022
Merged

nvazquez merged 1 commit into
apache:mainfrom
shapeblue:fiximportinstancesvmwaregub

Conversation

@nvazquez

@nvazquez nvazquez commented May 12, 2022

Copy link
Copy Markdown
Contributor

Description

This PR fixes the Vmware import unmanaged instances process, was failing due to a null detail value for SSHPublicKey:
Screen Shot 2022-05-12 at 09 06 08

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

Verified fix by importing VM successfully

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@sureshanaparti sureshanaparti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6384 (SL-JID-1565)

@shwstppr shwstppr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code lgtm

@shwstppr

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3395

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan test centos7 vmware-67u3

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian Build Failed (tid-4173)

@nvazquez

Copy link
Copy Markdown
Contributor Author

@blueorangutan test centos7 vmware-67u3

@blueorangutan

Copy link
Copy Markdown

@nvazquez a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-4176)
Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
Total time taken: 41902 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6384-t4176-vmware-67u3.zip
Smoke tests completed. 95 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_02_verify_ipv6_network_redundant Failure 175.52 test_network_ipv6.py

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@shwstppr

shwstppr commented May 13, 2022

Copy link
Copy Markdown
Contributor

Tested failed test on a VMware env, error is unrelated and seems to be some intermittent issue,

[root@pr6385-t4175-vmware-67u3-marvin marvin]# cat /marvin//MarvinLogs/test_network_ipv6_TY1ONW/results.txt 
Test to create network offering ... === TestName: test_01_create_ipv6_network_offering | Status : SUCCESS ===
ok
Test to create network offering ... === TestName: test_02_create_ipv6_network_offering_fail | Status : SUCCESS ===
ok
Test to create network offering ... === TestName: test_03_create_ipv6_vpc_offering | Status : SUCCESS ===
ok
Test to create VPC offering failure ... === TestName: test_04_create_ipv6_vpc_offering_fail | Status : SUCCESS ===
ok
Test to add IPv6 guest prefix ... === TestName: test_01_create_ipv6_guest_prefix | Status : SUCCESS ===
ok
Test to add IPv6 guest prefix failure ... === TestName: test_02_create_ipv6_guest_prefix_fail | Status : SUCCESS ===
ok
Test to verify IPv6 network ... === TestName: test_01_verify_ipv6_network | Status : SUCCESS ===
ok
Test to verify redundant IPv6 network ... === TestName: test_02_verify_ipv6_network_redundant | Status : SUCCESS ===
ok
Test to add IPv6 public IP range ... === TestName: test_01_create_ipv6_public_ip_range | Status : SUCCESS ===
ok
Test to add IPv6 public IP range failure ... === TestName: test_02_create_ipv6_public_ip_range_fail | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 10 tests in 1239.774s

OK

Also, tested import vm functionality with the test added in in #6385

[root@pr6385-t4175-vmware-67u3-marvin marvin]# nosetests --with-xunit --xunit-file=results.xml --with-marvin --marvin-config=./pr6385-t4175-vmware-67u3-advanced-cfg -s -a tags=advanced --hypervisor=VMware tests/smoke/test_vm_life_cycle_unmanage_import.py 
/usr/local/lib/python3.6/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend
/usr/local/lib/python3.6/site-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
  "class": algorithms.Blowfish,

==== Marvin Init Started ====

=== Marvin Parse Config Successful ===

=== Marvin Setting TestData Successful===

==== Log Folder Path: /marvin/MarvinLogs/May_13_2022_08_08_47_OI6KDY All logs will be available here ====

=== Marvin Init Logging Successful===

==== Marvin Init Successful ====
=== TestName: test_01_unmanage_vm_cycle | Status : SUCCESS ===

=== Final results are now copied to: /marvin//MarvinLogs/test_vm_life_cycle_unmanage_import_M0XC3L ===

And did a basic import test,

(localcloud) 🐱 > list unmanagedinstances clusterid=b86a0d57-cc67-4bfb-830c-7cc3164ad304 
{
  "count": 1,
  "unmanagedinstance": [
    {
      "clusterid": "b86a0d57-cc67-4bfb-830c-7cc3164ad304",
      "cpucorepersocket": 1,
      "cpunumber": 1,
      "cpuspeed": 0,
      "disk": [
        {
          "capacity": 2147483648,
          "controller": "ide",
          "controllerunit": 0,
          "datastorehost": "10.0.32.4",
          "datastorename": "7f79dfbc97263fe5a1a42d70c8193912",
          "datastorepath": "/acs/primary/pr6385-t4175-vmware-67u3/pr6385-t4175-vmware-67u3-esxi-pri1",
          "datastoretype": "NFS",
          "id": "61-3001",
          "imagepath": "[7f79dfbc97263fe5a1a42d70c8193912] i-2-58-VM/ROOT-58.vmdk",
          "label": "Hard disk 1",
          "position": 1
        }
      ],
      "hostid": "ce03ea49-725a-4882-8c56-54e88864bafe",
      "hostname": "10.0.33.213",
      "memory": 512,
      "name": "testvm",
      "nic": [
        {
          "adaptertype": "E1000",
          "id": "Network adapter 1",
          "macaddress": "02:00:38:e4:00:01",
          "networkname": "cloud.guest.1677.200.1-vSwitch1",
          "vlanid": 1677
        }
      ],
      "osdisplayname": "CentOS 4/5 or later (64-bit)",
      "osid": "centos64Guest",
      "powerstate": "PowerOn"
    }
  ]
}
(localcloud) 🐱 > import unmanagedinstance clusterid=b86a0d57-cc67-4bfb-830c-7cc3164ad304 name=testvm serviceofferingid=003a3a26-5da3-4452-9d32-475871985bcf 
{
  "virtualmachine": {
    "account": "admin",
    "affinitygroup": [],
    "cpunumber": 1,
    "cpuspeed": 500,
    "created": "2022-05-13T08:19:53+0000",
    "details": {
      "dataDiskController": "osdefault",
      "deployvm": "true",
      "nicAdapter": "E1000",
      "rootDiskController": "ide"
    },
    "displayname": "testvm",
    "displayvm": true,
    "domain": "ROOT",
    "domainid": "f55b35fb-d1fc-11ec-95de-1e001400043e",
    "guestosid": "f561239e-d1fc-11ec-95de-1e001400043e",
    "haenable": false,
    "hasannotations": false,
    "hostid": "ce03ea49-725a-4882-8c56-54e88864bafe",
    "hostname": "10.0.33.213",
    "hypervisor": "VMware",
    "id": "cccc2321-531d-457a-aa06-1ff062c546cc",
    "instancename": "i-2-58-VM",
    "isdynamicallyscalable": false,
    "memory": 512,
    "name": "testvm",
    "nic": [
      {
        "broadcasturi": "vlan://1677",
        "deviceid": "0",
        "extradhcpoption": [],
        "id": "42340299-0ed9-4612-85a7-d69c106909a1",
        "isdefault": true,
        "isolationuri": "vlan://1677",
        "macaddress": "02:00:38:e4:00:01",
        "networkid": "af1b6bc1-92ee-49ea-acff-d4f948228b6e",
        "networkname": "l2",
        "secondaryip": [],
        "traffictype": "Guest",
        "type": "L2"
      }
    ],
    "osdisplayname": "CentOS 5.0 (64-bit)",
    "ostypeid": "f561239e-d1fc-11ec-95de-1e001400043e",
    "passwordenabled": false,
    "pooltype": "NetworkFilesystem",
    "receivedbytes": 0,
    "rootdeviceid": 0,
    "rootdevicetype": "ROOT",
    "securitygroup": [],
    "sentbytes": 0,
    "serviceofferingid": "003a3a26-5da3-4452-9d32-475871985bcf",
    "serviceofferingname": "Small Instance",
    "state": "Running",
    "tags": [],
    "templatedisplaytext": "VM Import Default Template",
    "templateid": "f75e50d3-3e0e-47a1-8733-6c74c67c4a7f",
    "templatename": "system-default-vm-import-dummy-template.iso",
    "userid": "0f6488b9-d1fd-11ec-95de-1e001400043e",
    "username": "admin",
    "zoneid": "f75f9470-861a-42fa-906b-aa0df9f0001d",
    "zonename": "pr6385-t4175-vmware-67u3"
  }
}

@nvazquez
nvazquez merged commit 07cabb5 into apache:main May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants