Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Support edit of config for running cVMs and endpointVM #8637

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hickeng
Copy link
Member

@hickeng hickeng commented May 13, 2020

This updates config handling to make use of the fact that the bug1985862 has been addressed and in the field for a while now. That bug prevented us from using the vim API to update guestinfo keys while the VM was running as they would convert to non-persistent.

NOTE this PR should not be shipped without determining which ESX builds include that fix and a check of some kind during vic-machine install/upgrade to confirm that the target, or all current ESXs in the target cluster are of sufficiently high version.

This enables any of the blocked work such as docker network add <bridgenet> <cid> for running containers that was previously blocked.

There is a quirk in my validation of rename after upgrade; the rename applies in ESX but does not update the VIC metadata for the VM.
If I recall correctly we had a statement about levels of support for old containers, particularly those that had never been run. I think that's what I'm seeing but haven't tracked down the support statement.

ghicken@kube-worker:~/vic$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS               NAMES
bbd2a3a574e8        busybox             "/bin/ash"          6 seconds ago        Created                                 never-start
e0396488a573        busybox             "/bin/ash"          34 seconds ago       Up 20 seconds                           will-exit-after-rename
c358443dfe3a        busybox             "/bin/ash"          About a minute ago   Up 47 seconds                           will-rename
ab8fff253b49        busybox             "/bin/ash"          About a minute ago   Up About a minute                       wont-rename
ghicken@kube-worker:~/vic$ docker rename will-rename renamed
ghicken@kube-worker:~/vic$ docker rename will-exit-after-rename rename-and-exit
ghicken@kube-worker:~/vic$ docker rename never-start rename-not-started
ghicken@kube-worker:~/vic$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED              STATUS              PORTS               NAMES
bbd2a3a574e8        busybox             "/bin/ash"          About a minute ago   Created                                 rename-not-started
e0396488a573        busybox             "/bin/ash"          About a minute ago   Up About a minute                       rename-and-exit
c358443dfe3a        busybox             "/bin/ash"          2 minutes ago        Up About a minute                       renamed
ab8fff253b49        busybox             "/bin/ash"          2 minutes ago        Up 2 minutes                            wont-rename
ghicken@kube-worker:~/vic$ vic-ls
INFO[0000] ### Listing VCHs ####
INFO[0000] Validating target

ID        PATH                                                                  NAME           VERSION                      UPGRADE STATUS
8         /ha-datacenter/host/sc2-10-185-251-91.eng.vmware.com/Resources        vic-esx        v1.5.5-21324-50a44954        VCH has newer version
ghicken@kube-worker:~/vic$ vic-upgrade --force
INFO[0000] ### Upgrading VCH ####
INFO[0000] Validating target
WARN[0000] Disabling ha-host hostd.log collection (ServerFaultCode: Cannot complete the operation due to an incorrect request to the server.)
INFO[0000]
INFO[0000] VCH ID: VirtualMachine:8
INFO[0000] Creating directory [datastore1] vic-esx
INFO[0000] datastore root [datastore1] vic-esx already exists
INFO[0000] Datastore path is [datastore1] vic-esx
INFO[0000] Uploading ISO images
INFO[0000] Uploading appliance.iso as V1.5.5-0-5F70FBD30-appliance.iso
INFO[0009] Uploading bootstrap.iso as V1.5.5-0-5F70FBD30-bootstrap.iso
INFO[0015] Switching appliance iso to [datastore1] vic-esx/V1.5.5-0-5F70FBD30-appliance.iso
INFO[0015] Setting VM configuration
INFO[0016] Waiting for IP information
INFO[0022] Waiting for major appliance components to launch
INFO[0031] Obtained IP address for client interface: "10.185.246.19"
INFO[0031] Checking VCH connectivity with vSphere target
INFO[0031] vSphere API Test: https://10.185.251.91 vSphere API target responds as expected
WARN[0034] Server certificate hostname doesn't match: x509: cannot validate certificate for 10.185.246.19 because it doesn't contain any IP SANs
INFO[0034] Completed successfully
ghicken@kube-worker:~/vic$ vic-ssh
SSH to sc2-10-185-246-19.eng.vmware.com
Warning: Permanently added 'sc2-10-185-246-19.eng.vmware.com,10.185.246.19' (ECDSA) to the list of known hosts.
Warning: your password will expire in 0 days
root@vic-esx [ ~ ]# exit
ghicken@kube-worker:~/vic$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                       PORTS               NAMES
bbd2a3a574e8        busybox             "/bin/ash"          7 minutes ago       Created                                          rename-not-started
e0396488a573        busybox             "/bin/ash"          7 minutes ago       Exited (143) 5 minutes ago                       rename-and-exit
c358443dfe3a        busybox             "/bin/ash"          8 minutes ago       Up 8 minutes                                     renamed
ab8fff253b49        busybox             "/bin/ash"          9 minutes ago       Up 8 minutes                                     wont-rename
ghicken@kube-worker:~/vic$ docker rename rename-and-exit renamed-again
ghicken@kube-worker:~/vic$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                       PORTS               NAMES
bbd2a3a574e8        busybox             "/bin/ash"          8 minutes ago       Created                                          rename-not-started
e0396488a573        busybox             "/bin/ash"          8 minutes ago       Exited (143) 6 minutes ago                       renamed-again
c358443dfe3a        busybox             "/bin/ash"          8 minutes ago       Up 8 minutes                                     renamed
ab8fff253b49        busybox             "/bin/ash"          9 minutes ago       Up 9 minutes                                     wont-rename
ghicken@kube-worker:~/vic$ docker rename rename-not-started not-started-renamed-post-upgrade
ghicken@kube-worker:~/vic$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                       PORTS               NAMES
bbd2a3a574e8        busybox             "/bin/ash"          8 minutes ago       Created                                          rename-not-started
e0396488a573        busybox             "/bin/ash"          9 minutes ago       Exited (143) 6 minutes ago                       renamed-again
c358443dfe3a        busybox             "/bin/ash"          9 minutes ago       Up 9 minutes                                     renamed
ab8fff253b49        busybox             "/bin/ash"          10 minutes ago      Up 10 minutes                                    wont-rename
ghicken@kube-worker:~/vic$ govc ls /ha-datacenter/vm
/ha-datacenter/vm/renamed-c358443dfe3a
/ha-datacenter/vm/renamed-again-e0396488a573
/ha-datacenter/vm/not-started-renamed-post-upgrade-bbd2a3a574e8
/ha-datacenter/vm/vic-esx
/ha-datacenter/vm/wont-rename-ab8fff253b49
ghicken@kube-worker:~/vic$

Related #5553

[full ci]

This adds the generated VIC service bindings to the ingore
set for linting due to package names containing underscores.
This will present on all but the first build in a given build
env.
The Name field was changed to be hidden from the guest in vmware#4134 to
support docker rename. This was a compromise needed due to an ESX
vigor bug, see vmware#5533.

This *requires* that users be on a version of ESX that has the fix
or bad things may happen to cVM configurations. I have not tracked
down what build versions that entails and have not code a check
mechanism.

This change has the effect of the hostname of the VCH endpointVM
being set to the name of the VCH.
It also allows additional live reconfiguration such as hotadd to
a bridge network, in general modification of all container
configuration live is possible, if not necessarily applied.
@hickeng hickeng added kind/enhancement Behavior that was intended, but we want to make better area/vsphere Intergration and interoperation with vSphere area/appliance component/portlayer/execution impact/doc/note Requires creation of or changes to an official release note kind/debt Problems that increase the cost of other work source/customer Reported by a customer, directly or via an intermediary component/config labels May 13, 2020
@hickeng hickeng requested a review from a team as a code owner May 13, 2020 05:43
@hickeng hickeng marked this pull request as draft May 13, 2020 13:04
@ading007 ading007 self-requested a review June 1, 2020 07:41
@hickeng hickeng changed the title Support edit of config for running cVMs and endpointVM WIP: Support edit of config for running cVMs and endpointVM Dec 3, 2022
@hickeng
Copy link
Member Author

hickeng commented Dec 3, 2022

Turns out the guestinfo "fix" did not address making persistent changes to keys on a running VM via the API, so the old problems with updating a live cVM are all still present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/appliance area/vsphere Intergration and interoperation with vSphere cla-not-required component/config component/portlayer/execution impact/doc/note Requires creation of or changes to an official release note kind/debt Problems that increase the cost of other work kind/enhancement Behavior that was intended, but we want to make better source/customer Reported by a customer, directly or via an intermediary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants